X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_joystick.c;h=2a57e2936152a85fe7b85e65f088899f406c0cd2;hb=ac26c64653954569627ad5413240cbd8453cd814;hp=c00937769816609c38cb3eae805f94856c1ee2ef;hpb=948dac464323f059e902d27241fc8936399b03b9;p=freeglut diff --git a/src/freeglut_joystick.c b/src/freeglut_joystick.c index c009377..2a57e29 100644 --- a/src/freeglut_joystick.c +++ b/src/freeglut_joystick.c @@ -75,7 +75,7 @@ # if HAVE_FCNTL_H # include # endif -# if HAVE_ERRNO +# if HAVE_ERRNO_H # include # 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