}
}
+#ifdef __DJGPP__
+ /* snprintf is missing in DJGPP (v2.0.3) */
+# define GC_SNPRINTF sprintf
+# define GC_SNPRINTF_BUFSZ_ARG(bufsz) /* empty */
+#else
+# if defined(_MSC_VER)
+# if defined(_WIN32_WCE)
+ /* _snprintf is deprecated in WinCE */
+# define GC_SNPRINTF StringCchPrintfA
+# else
+# define GC_SNPRINTF _snprintf
+# endif
+# else
+# define GC_SNPRINTF snprintf
+# endif
+# define GC_SNPRINTF_BUFSZ_ARG(bufsz) (bufsz),
+#endif
+
void test_printf(void)
{
CORD result;
x = CORD_cat(x,x);
if (CORD_sprintf(&result, "->%-120.78r!\n", x) != 124)
ABORT("CORD_sprintf failed 3");
- (void)snprintf(result2, sizeof(result2), "->%-120.78s!\n",
- CORD_to_char_star(x));
+ (void)GC_SNPRINTF(result2, GC_SNPRINTF_BUFSZ_ARG(sizeof(result2))
+ "->%-120.78s!\n", CORD_to_char_star(x));
result2[sizeof(result2) - 1] = '\0';
if (CORD_cmp(result, result2) != 0)ABORT("CORD_sprintf goofed 5");
}
#define BUFSZ 1024
-#ifdef NO_VSNPRINTF
- /* In case this function is missing (e.g., in DJGPP v2.0.3). */
+#ifdef DJGPP
+ /* vsnprintf is missing in DJGPP (v2.0.3) */
# define GC_VSNPRINTF(buf, bufsz, format, args) vsprintf(buf, format, args)
#elif defined(_MSC_VER)
# ifdef MSWINCE