X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Fx11%2Ffg_joystick_x11.c;h=a37388b84e7dcabf0714c2caace330adfd8a4412;hb=63922c1586329f2ed481453aa9175ecc7b235adb;hp=1815577f3cc8cc372b40e8ddf5cc5141d16e4c5b;hpb=0e653a9d94fec583f7a4172b721c1c599e06cbc8;p=freeglut diff --git a/src/x11/fg_joystick_x11.c b/src/x11/fg_joystick_x11.c index 1815577..a37388b 100644 --- a/src/x11/fg_joystick_x11.c +++ b/src/x11/fg_joystick_x11.c @@ -1,5 +1,5 @@ /* - * freeglut_joystick_x11.c + * fg_joystick_x11.c * * Joystick handling code * @@ -39,6 +39,8 @@ # include #endif +#include + /*this should be defined in a header file */ #define MAX_NUM_JOYSTICKS 2 @@ -115,11 +117,7 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) } } } -# ifdef HAVE_ERRNO_H if ( len < 0 && errno != EAGAIN ) -# else - if ( len < 0 ) -# endif { perror( joy->pJoystick.os->fname ); joy->error = 1; @@ -138,7 +136,6 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) if ( status != sizeof( struct js_event ) ) { -# ifdef HAVE_ERRNO_H if ( errno == EAGAIN ) { /* Use the old values */ @@ -149,7 +146,6 @@ void fgPlatformJoystickRawRead( SFG_Joystick* joy, int* buttons, float* axes ) sizeof( float ) * joy->num_axes ); return; } -# endif fgWarning ( "%s", joy->pJoystick.fname ); joy->error = GL_TRUE; @@ -241,10 +237,8 @@ void fgPlatformJoystickOpen( SFG_Joystick* joy ) joy->pJoystick.os->fd = open( joy->pJoystick.os->fname, O_RDONLY | O_NONBLOCK); -#ifdef HAVE_ERRNO_H if( joy->pJoystick.os->fd < 0 && errno == EACCES ) fgWarning ( "%s exists but is not readable by you", joy->pJoystick.os->fname ); -#endif joy->error =( joy->pJoystick.os->fd < 0 );