[Freeswitch-svn] [commit] r6665 - freeswitch/trunk/src/include

Freeswitch SVN mikej at freeswitch.org
Tue Dec 11 15:25:16 EST 2007


Author: mikej
Date: Tue Dec 11 15:25:15 2007
New Revision: 6665

Modified:
   freeswitch/trunk/src/include/switch_platform.h
   freeswitch/trunk/src/include/switch_utils.h

Log:
cleanup some macros a bit more.

Modified: freeswitch/trunk/src/include/switch_platform.h
==============================================================================
--- freeswitch/trunk/src/include/switch_platform.h	(original)
+++ freeswitch/trunk/src/include/switch_platform.h	Tue Dec 11 15:25:15 2007
@@ -69,7 +69,7 @@
 #pragma include_alias(<libteletone_generate.h>,		<../../libs/libteletone/src/libteletone_generate.h>)
 #pragma include_alias(<libteletone_detect.h>,		<../../libs/libteletone/src/libteletone_detect.h>)
 
-#if (_MSC_VER >= 1500)			// VC8+
+#if (_MSC_VER >= 1500)			// VC9+
 #define switch_assert(expr) assert(expr);__analysis_assume( expr )
 #endif
 

Modified: freeswitch/trunk/src/include/switch_utils.h
==============================================================================
--- freeswitch/trunk/src/include/switch_utils.h	(original)
+++ freeswitch/trunk/src/include/switch_utils.h	Tue Dec 11 15:25:15 2007
@@ -352,9 +352,14 @@
 #define switch_malloc(ptr, len) (void)( (!!(ptr = malloc(len))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%s", __FILE__, __LINE__),abort(), 0), ptr )
 #define switch_zmalloc(ptr, len) (void)( (!!(ptr = malloc(len))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%s", __FILE__, __LINE__),abort(), 0), memset(ptr, 0, len))
 #else
+#if (_MSC_VER >= 1500)			// VC9+
+#define switch_malloc(ptr, len) (void)(assert(((ptr) = malloc((len)))),ptr);__analysis_assume( ptr )
+#define switch_zmalloc(ptr, len) (void)(assert((ptr = malloc(len))),memset(ptr, 0, len));__analysis_assume( ptr )
+#else
 #define switch_malloc(ptr, len) (void)(assert(((ptr) = malloc((len)))),ptr)
 #define switch_zmalloc(ptr, len) (void)(assert((ptr = malloc(len))),memset(ptr, 0, len))
 #endif
+#endif
 
 SWITCH_END_EXTERN_C
 #endif



More information about the Freeswitch-svn mailing list