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

Freeswitch SVN mikej at freeswitch.org
Fri Mar 16 17:03:38 EDT 2007


Author: mikej
Date: Fri Mar 16 17:03:38 2007
New Revision: 4621

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

Log:
use _snprintf instead of switch_snprintf on windows for now.. snprintf seems to be having issues handling anything that uses the #define'd format strings for time t and 64 bit ints on windows.

Modified: freeswitch/trunk/src/include/switch_apr.h
==============================================================================
--- freeswitch/trunk/src/include/switch_apr.h	(original)
+++ freeswitch/trunk/src/include/switch_apr.h	Fri Mar 16 17:03:38 2007
@@ -131,10 +131,6 @@
  * @{
  */
 
-#ifndef snprintf
-#define snprintf switch_snprintf
-#endif
-
 SWITCH_DECLARE(int) switch_snprintf(char *buf, switch_size_t len, const char *format, ...);
 
 SWITCH_DECLARE(int) switch_vasprintf(char **buf, const char *format, va_list ap);

Modified: freeswitch/trunk/src/include/switch_platform.h
==============================================================================
--- freeswitch/trunk/src/include/switch_platform.h	(original)
+++ freeswitch/trunk/src/include/switch_platform.h	Fri Mar 16 17:03:38 2007
@@ -101,6 +101,10 @@
 #include <io.h>
 #define strcasecmp(s1, s2) stricmp(s1, s2)
 #define strncasecmp(s1, s2, n) strnicmp(s1, s2, n)
+#ifndef snprintf
+#define snprintf _snprintf
+#endif
+
 #else
 /* packed attribute */
 #ifndef PACKED
@@ -199,31 +203,31 @@
 #ifdef WIN32
 
 #ifdef WIN64
-#define SWITCH_SSIZE_T_FMT          "%I64d"
-#define SWITCH_SIZE_T_FMT           "%I64d"
+#define SWITCH_SSIZE_T_FMT          "I64d"
+#define SWITCH_SIZE_T_FMT           "I64d"
 #else
-#define SWITCH_SSIZE_T_FMT          "%d"
-#define SWITCH_SIZE_T_FMT           "%d"
+#define SWITCH_SSIZE_T_FMT          "d"
+#define SWITCH_SIZE_T_FMT           "d"
 #endif
 
-#define SWITCH_INT64_T_FMT          "%I64d"
-#define SWITCH_UINT64_T_FMT         "%I64u"
+#define SWITCH_INT64_T_FMT          "I64d"
+#define SWITCH_UINT64_T_FMT         "I64u"
 
 #else
 #ifndef SWITCH_SSIZE_T_FMT
-#define SWITCH_SSIZE_T_FMT          (sizeof (switch_ssize_t) == sizeof (long) ? "%ld" : sizeof (switch_ssize_t) == sizeof (int) ? "%d" : "%lld")
+#define SWITCH_SSIZE_T_FMT          (sizeof (switch_ssize_t) == sizeof (long) ? "ld" : sizeof (switch_ssize_t) == sizeof (int) ? "d" : "lld")
 #endif
 
 #ifndef SWITCH_SIZE_T_FMT
-#define SWITCH_SIZE_T_FMT           (sizeof (switch_size_t) == sizeof (long) ? "%lu" : sizeof (switch_size_t) == sizeof (int) ? "%u" : "%llu")
+#define SWITCH_SIZE_T_FMT           (sizeof (switch_size_t) == sizeof (long) ? "lu" : sizeof (switch_size_t) == sizeof (int) ? "u" : "llu")
 #endif
 
 #ifndef SWITCH_INT64_T_FMT
-#define SWITCH_INT64_T_FMT          (sizeof (long) == 8 ? "%ld" : "%lld")
+#define SWITCH_INT64_T_FMT          (sizeof (long) == 8 ? "ld" : "lld")
 #endif
 
 #ifndef SWITCH_UINT64_T_FMT
-#define SWITCH_UINT64_T_FMT         (sizeof (long) == 8 ? "%lu" : "%llu")
+#define SWITCH_UINT64_T_FMT         (sizeof (long) == 8 ? "lu" : "llu")
 #endif
 
 #endif



More information about the Freeswitch-svn mailing list