From 3a5f3f1820b899909e687cd984e402c2c711c68f Mon Sep 17 00:00:00 2001 From: Lauri Kasanen Date: Thu, 21 Aug 2014 12:01:46 +0000 Subject: Use system vsnprintf when possible, saves 2kb lib size. Currently with Linux guards, as the function seems to be broken in Windows. git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3@10229 ea41ed52-d2ee-0310-a9c1-e6b18d33e121 --- src/vsnprintf.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vsnprintf.c b/src/vsnprintf.c index c7e51db75..eb039f0b0 100644 --- a/src/vsnprintf.c +++ b/src/vsnprintf.c @@ -28,6 +28,9 @@ extern "C" { #endif int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { +#if defined(HAVE_VSNPRINTF) && defined(__linux__) + return vsnprintf(buffer, bufsize, format, ap); +#else char *bufptr, /* Pointer to position in buffer */ *bufend, /* Pointer to end of buffer */ sign, /* Sign of format width */ @@ -251,6 +254,7 @@ int fl_vsnprintf(char* buffer, size_t bufsize, const char* format, va_list ap) { if (bufptr) *bufptr = '\0'; return (bytes); +#endif //HAVE_VSNPRINTF } int fl_snprintf(char* str, size_t size, const char* fmt, ...) { -- cgit v1.2.3