summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLauri Kasanen <cand@gmx.com>2014-08-21 12:01:46 +0000
committerLauri Kasanen <cand@gmx.com>2014-08-21 12:01:46 +0000
commit3a5f3f1820b899909e687cd984e402c2c711c68f (patch)
tree328785bb5591e2e5a2b7b5d8b7b9d5070ebc4fa3
parentf44d3fe01c8646586438e0af8826f1469bb96cdc (diff)
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
-rw-r--r--src/vsnprintf.c4
1 files changed, 4 insertions, 0 deletions
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, ...) {