Uploading spaceball/set-window patch per e-mail from John Tsiombikas dated 1:34 PM...
[freeglut] / src / freeglut_joystick.c
index c009377..2a57e29 100644 (file)
@@ -75,7 +75,7 @@
 #    if HAVE_FCNTL_H
 #        include <fcntl.h>
 #    endif
-#    if HAVE_ERRNO
+#    if HAVE_ERRNO_H
 #        include <errno.h>
 #    endif
 #    if defined(__FreeBSD__) || defined(__NetBSD__)
@@ -240,7 +240,7 @@ static int fghJoystickFindUSBdev(char *name, char *out, int outlen)
       if (cp)
         return 1;
     }
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
     else if (errno == EACCES) {
       if (!protection_warned) {
         fgWarning ( "Can't open %s for read!", buf );
@@ -265,7 +265,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os,
 
     if ( ( rd = hid_get_report_desc( os->fd ) ) == 0 )
     {
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
         fgWarning ( "error: %s: %s", os->fname, strerror( errno ) );
 #else
         fgWarning ( "error: %s", os->fname );
@@ -279,7 +279,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os,
         if( ioctl( os->fd, USB_GET_REPORT_ID, &report_id ) < 0)
         {
             /*** XXX {report_id} may not be the right variable? ***/
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
             fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) );
 #else
             fgWarning ( "error: %s%d", UHIDDEV, report_id );
@@ -676,7 +676,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
             }
         }
     }
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
     if ( len < 0 && errno != EAGAIN )
 #else
     if ( len < 0 )
@@ -699,7 +699,7 @@ static void fghJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes )
 
         if ( status != sizeof( struct js_event ) )
         {
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
             if ( errno == EAGAIN )
             {
                 /* Use the old values */
@@ -1317,7 +1317,7 @@ static void fghJoystickOpen( SFG_Joystick* joy )
 
     joy->os->fd = open( joy->os->fname, O_RDONLY | O_NONBLOCK);
 
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
     if( joy->os->fd < 0 && errno == EACCES )
         fgWarning ( "%s exists but is not readable by you", joy->os->fname );
 #endif