cleaned up a bunch of warnings
[freeglut] / progs / demos / Lorenz / lorenz.c
index 98361bc..a3a61db 100644 (file)
@@ -33,7 +33,7 @@
 #include <string.h>
 #include <math.h>
 #include <GL/freeglut.h>
-#ifdef WIN32
+#ifdef _MSC_VER
 /* DUMP MEMORY LEAKS */
 #include <crtdbg.h>
 #endif
@@ -220,8 +220,7 @@ void mouse_cb ( int button, int updown, int x, int y )
 {
   if ( updown == GLUT_DOWN )
   {
-    double dist = 1.0e20 ;  /* A very large number */
-    dist = 0.0 ;  /* so we don't get "unused variable" compiler warning */
+    /*double dist = 1.0e20 ;   A very large number */
     /* The idea here is that we go into "pick" mode and pick the nearest point
        to the mouse click position.  Unfortunately I don't have the time to implement
        it at the moment. */
@@ -249,7 +248,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 ) ;
 }
@@ -365,7 +368,7 @@ int main ( int argc, char *argv[] )
   /* Enter the GLUT main loop */
   glutMainLoop () ;
 
-#ifdef WIN32
+#ifdef _MSC_VER
   /* DUMP MEMORY LEAK INFORMATION */
   _CrtDumpMemoryLeaks () ;
 #endif