summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2013-08-15 06:53:11 +0200
committerIvan Maidanski <ivmai@mail.ru>2013-08-15 13:04:54 +0200
commit593ab3d24584f3fb9a11c624dedf54ba7fdcdcd2 (patch)
tree690c4bb29d570dc56ff242456aa6a1fc5710fd65
parentb8579aff1f2f3c5feba810a513c764d5c5770c86 (diff)
Define GC_VSNPRINTF internal macro in misc.c (code refactoring)
* misc.c (GC_VSNPRINTF): New macro (defined to vsnprintf by default and used by GC_PRINTF_FILLBUF).
-rw-r--r--misc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/misc.c b/misc.c
index b6aa54e..8e2da68 100644
--- a/misc.c
+++ b/misc.c
@@ -1494,14 +1494,16 @@ GC_API void GC_CALL GC_enable_incremental(void)
#ifdef NO_VSNPRINTF
/* In case this function is missing (eg., in DJGPP v2.0.3). */
-# define vsnprintf(buf, bufsz, format, args) vsprintf(buf, format, args)
+# define GC_VSNPRINTF(buf, bufsz, format, args) vsprintf(buf, format, args)
#elif defined(_MSC_VER)
# ifdef MSWINCE
/* _vsnprintf is deprecated in WinCE */
-# define vsnprintf StringCchVPrintfA
+# define GC_VSNPRINTF StringCchVPrintfA
# else
-# define vsnprintf _vsnprintf
+# define GC_VSNPRINTF _vsnprintf
# endif
+#else
+# define GC_VSNPRINTF vsnprintf
#endif
/* A version of printf that is unlikely to call malloc, and is thus safer */
@@ -1514,7 +1516,7 @@ GC_API void GC_CALL GC_enable_incremental(void)
va_list args; \
va_start(args, format); \
(buf)[sizeof(buf) - 1] = 0x15; /* guard */ \
- (void)vsnprintf(buf, sizeof(buf) - 1, format, args); \
+ (void)GC_VSNPRINTF(buf, sizeof(buf) - 1, format, args); \
va_end(args); \
if ((buf)[sizeof(buf) - 1] != 0x15) \
ABORT("GC_printf clobbered stack"); \