X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_input_devices.c;h=04f5fd5d5c11fa79e43a3b6a46094c70be3e7c5f;hb=67e12a9904a16f2765c33dcd75b31926691416f1;hp=142ee4c7571ff3a300afc5cbf3c82ceb8b7e5695;hpb=9d658d3079abac17672c300ee614ed4cf41a0553;p=freeglut diff --git a/src/freeglut_input_devices.c b/src/freeglut_input_devices.c index 142ee4c..04f5fd5 100755 --- a/src/freeglut_input_devices.c +++ b/src/freeglut_input_devices.c @@ -36,17 +36,15 @@ #include "freeglut_internal.h" #if TARGET_HOST_POSIX_X11 +#ifdef HAVE_ERRNO_H #include +#endif #include -#include -#include #include #include -#include #include #include #include -#include typedef struct { int fd; @@ -136,17 +134,10 @@ int fgInputDeviceDetect( void ) */ void fgInitialiseInputDevices ( void ) { - const char *dial_device=NULL; if( !fgState.InputDevsInitialised ) { -#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher - size_t sLen; - errno_t err = _dupenv_s( &dial_device, &sLen, "GLUT_DIALS_SERIAL" ); - if (err) - fgError("Error getting GLUT_DIALS_SERIAL environment variable"); -#else + const char *dial_device=NULL; dial_device = getenv ( "GLUT_DIALS_SERIAL" ); -#endif #if TARGET_HOST_MS_WINDOWS if (!dial_device){ static char devname[256]; @@ -163,9 +154,6 @@ void fgInitialiseInputDevices ( void ) #endif if ( !dial_device ) return; if ( !( dialbox_port = serial_open ( dial_device ) ) ) return; -#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher - free ( dial_device ); dial_device = NULL; /* dupenv_s allocates a string that we must free */ -#endif serial_putchar(dialbox_port,DIAL_INITIALIZE); glutTimerFunc ( 10, poll_dials, 0 ); fgState.InputDevsInitialised = GL_TRUE;