From 83552a5fdc6c886dcba2f6da06d3ffb1f856d81f Mon Sep 17 00:00:00 2001 From: jtsiomb Date: Mon, 20 Oct 2014 15:27:04 +0000 Subject: [PATCH] removed all HAVE_ERRNO checks git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@1724 7f0cb862-5218-0410-a997-914c9d46530a --- freeglut/freeglut/src/fg_joystick.c | 10 ---------- freeglut/freeglut/src/fg_main.c | 4 +--- freeglut/freeglut/src/x11/fg_input_devices_x11.c | 2 -- freeglut/freeglut/src/x11/fg_internal_x11.h | 8 ++++---- freeglut/freeglut/src/x11/fg_joystick_x11.c | 8 -------- freeglut/freeglut/src/x11/fg_main_x11.c | 6 +----- freeglut/freeglut/src/x11/fg_spaceball_x11.c | 3 --- 7 files changed, 6 insertions(+), 35 deletions(-) diff --git a/freeglut/freeglut/src/fg_joystick.c b/freeglut/freeglut/src/fg_joystick.c index 9831fb1..7d4c502 100644 --- a/freeglut/freeglut/src/fg_joystick.c +++ b/freeglut/freeglut/src/fg_joystick.c @@ -147,14 +147,12 @@ static int fghJoystickFindUSBdev(char *name, char *out, int outlen) if (cp) return 1; } -#ifdef HAVE_ERRNO_H else if (errno == EACCES) { if (!protection_warned) { fgWarning ( "Can't open %s for read!", buf ); protection_warned = 1; } } -#endif } return 0; } @@ -172,11 +170,7 @@ static int fghJoystickInitializeHID(struct os_specific_s *os, if ( ( rd = hid_get_report_desc( os->fd ) ) == 0 ) { -#ifdef HAVE_ERRNO_H fgWarning ( "error: %s: %s", os->fname, strerror( errno ) ); -#else - fgWarning ( "error: %s", os->fname ); -#endif return FALSE; } @@ -186,11 +180,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? ***/ -#ifdef HAVE_ERRNO_H fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) ); -#else - fgWarning ( "error: %s%d", UHIDDEV, report_id ); -#endif return FALSE; } diff --git a/freeglut/freeglut/src/fg_main.c b/freeglut/freeglut/src/fg_main.c index 240e5f7..330a7bc 100644 --- a/freeglut/freeglut/src/fg_main.c +++ b/freeglut/freeglut/src/fg_main.c @@ -27,9 +27,7 @@ #include #include "fg_internal.h" -#ifdef HAVE_ERRNO_H -# include -#endif +#include #include /* diff --git a/freeglut/freeglut/src/x11/fg_input_devices_x11.c b/freeglut/freeglut/src/x11/fg_input_devices_x11.c index 3c7e808..a25de69 100644 --- a/freeglut/freeglut/src/x11/fg_input_devices_x11.c +++ b/freeglut/freeglut/src/x11/fg_input_devices_x11.c @@ -33,9 +33,7 @@ #include #include "../fg_internal.h" -#ifdef HAVE_ERRNO_H #include -#endif #include #include #include diff --git a/freeglut/freeglut/src/x11/fg_internal_x11.h b/freeglut/freeglut/src/x11/fg_internal_x11.h index e6b512c..09a238a 100644 --- a/freeglut/freeglut/src/x11/fg_internal_x11.h +++ b/freeglut/freeglut/src/x11/fg_internal_x11.h @@ -131,10 +131,10 @@ struct tagSFG_PlatformWindowState # ifdef HAVE_FCNTL_H # include # endif -# ifdef HAVE_ERRNO_H -# include -# include -# endif + +#include +#include + # if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__NetBSD__) /* XXX The below hack is done until freeglut's autoconf is updated. */ # define HAVE_USB_JS 1 diff --git a/freeglut/freeglut/src/x11/fg_joystick_x11.c b/freeglut/freeglut/src/x11/fg_joystick_x11.c index 9712d1c..17dc2c3 100644 --- a/freeglut/freeglut/src/x11/fg_joystick_x11.c +++ b/freeglut/freeglut/src/x11/fg_joystick_x11.c @@ -115,11 +115,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 +134,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 +144,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 +235,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 ); diff --git a/freeglut/freeglut/src/x11/fg_main_x11.c b/freeglut/freeglut/src/x11/fg_main_x11.c index 2e13f38..0e54253 100644 --- a/freeglut/freeglut/src/x11/fg_main_x11.c +++ b/freeglut/freeglut/src/x11/fg_main_x11.c @@ -28,9 +28,7 @@ #include #include "../fg_internal.h" -#ifdef HAVE_ERRNO_H -# include -#endif +#include #include @@ -118,10 +116,8 @@ void fgPlatformSleepForEvents( fg_time_t msec ) wait.tv_usec = (msec % 1000) * 1000; err = select( socket+1, &fdset, NULL, NULL, &wait ); -#ifdef HAVE_ERRNO_H if( ( -1 == err ) && ( errno != EINTR ) ) fgWarning ( "freeglut select() error: %d", errno ); -#endif } } diff --git a/freeglut/freeglut/src/x11/fg_spaceball_x11.c b/freeglut/freeglut/src/x11/fg_spaceball_x11.c index 582a926..e6eabb2 100644 --- a/freeglut/freeglut/src/x11/fg_spaceball_x11.c +++ b/freeglut/freeglut/src/x11/fg_spaceball_x11.c @@ -174,10 +174,7 @@ OF SUCH DAMAGE. #include #include #include - -#ifdef HAVE_ERRNO_H #include -#endif #include #include