2011-05-31 Ivan Maidanski <ivmai@mail.ru>
authorivmai <ivmai>
Tue, 31 May 2011 09:53:36 +0000 (09:53 +0000)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 26 Jul 2011 17:06:59 +0000 (21:06 +0400)
* misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF.

ChangeLog
misc.c

index b31e5ed..cbba252 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
 
+       * misc.c (vsnprintf): Redirect to vsprintf() if NO_VSNPRINTF.
+
+2011-05-31  Ivan Maidanski  <ivmai@mail.ru>
+
        * win32_threads.c (GC_unregister_my_thread): Use KNOWN_FINISHED()
        instead of FINISHED macro.
        * tests/test.c (check_heap_stats): Round up max_heap_sz value for
diff --git a/misc.c b/misc.c
index 50d55e0..428cffe 100644 (file)
--- a/misc.c
+++ b/misc.c
@@ -1300,7 +1300,11 @@ GC_API void GC_CALL GC_enable_incremental(void)
 #endif /* !MSWIN32 && !OS2 && !MACOS */
 
 #define BUFSZ 1024
-#ifdef _MSC_VER
+
+#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)
+#elif defined(_MSC_VER)
 # ifdef MSWINCE
     /* _vsnprintf is deprecated in WinCE */
 #   define vsnprintf StringCchVPrintfA