From 7c94f971b4d7ba14c994cb961898a32111ae2d12 Mon Sep 17 00:00:00 2001 From: "John F. Fay" Date: Sun, 1 Mar 2009 21:23:24 +0000 Subject: [PATCH] Fixing Microsoft compatibility with the new "vsnprintf" by putting an underscore in front of it if WIN32 is defined but __CYGWIN__ is not git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@792 7f0cb862-5218-0410-a997-914c9d46530a --- progs/demos/CallbackMaker/CallbackMaker.c | 4 ++++ progs/demos/Lorenz/lorenz.c | 4 ++++ progs/demos/shapes/shapes.c | 4 ++++ 3 files changed, 12 insertions(+) diff --git a/progs/demos/CallbackMaker/CallbackMaker.c b/progs/demos/CallbackMaker/CallbackMaker.c index e952c25..25e83dc 100644 --- a/progs/demos/CallbackMaker/CallbackMaker.c +++ b/progs/demos/CallbackMaker/CallbackMaker.c @@ -37,7 +37,11 @@ bitmapPrintf (const char *fmt, ...) va_list args; va_start(args, fmt); +#if defined(WIN32) && !defined(__CYGWIN__) + (void) _vsnprintf (buf, sizeof(buf), fmt, args); +#else (void) vsnprintf (buf, sizeof(buf), fmt, args); +#endif va_end(args); glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)buf ) ; } diff --git a/progs/demos/Lorenz/lorenz.c b/progs/demos/Lorenz/lorenz.c index 366c7e4..6a816b2 100644 --- a/progs/demos/Lorenz/lorenz.c +++ b/progs/demos/Lorenz/lorenz.c @@ -249,7 +249,11 @@ void bitmapPrintf (const char *fmt, ...) va_list args; va_start(args, fmt); +#if defined(WIN32) && !defined(__CYGWIN__) + (void) _vsnprintf (buf, sizeof(buf), fmt, args); +#else (void) vsnprintf (buf, sizeof(buf), fmt, args); +#endif va_end(args); glutBitmapString ( GLUT_BITMAP_HELVETICA_12, (unsigned char*)buf ) ; } diff --git a/progs/demos/shapes/shapes.c b/progs/demos/shapes/shapes.c index 66eb8d4..4171551 100644 --- a/progs/demos/shapes/shapes.c +++ b/progs/demos/shapes/shapes.c @@ -189,7 +189,11 @@ static void shapesPrintf (int row, int col, const char *fmt, ...) va_list args; va_start(args, fmt); +#if defined(WIN32) && !defined(__CYGWIN__) + (void) _vsnprintf (buf, sizeof(buf), fmt, args); +#else (void) vsnprintf (buf, sizeof(buf), fmt, args); +#endif va_end(args); glGetIntegerv(GL_VIEWPORT,viewport); -- 1.7.10.4