Uploading spaceball/set-window patch per e-mail from John Tsiombikas dated 1:34 PM...
[freeglut] / src / freeglut_input_devices.c
index 1734a42..0dcb97f 100755 (executable)
@@ -36,7 +36,9 @@
 #include "freeglut_internal.h"
 
 #if TARGET_HOST_POSIX_X11
+#if HAVE_ERRNO_H
 #include <errno.h>
+#endif
 #include <sys/ioctl.h>
 #include <sys/time.h>
 #include <time.h>
@@ -136,9 +138,9 @@ int fgInputDeviceDetect( void )
  */
 void fgInitialiseInputDevices ( void )
 {
-    const char *dial_device=NULL;
     if( !fgState.InputDevsInitialised )
     {
+        const char *dial_device=NULL;
         dial_device = getenv ( "GLUT_DIALS_SERIAL" );
 #if TARGET_HOST_MS_WINDOWS
         if (!dial_device){