X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Ffreeglut_input_devices.c;h=0dcb97f7c9a1d9e70376c52ed7004926db2c1e8f;hb=ac26c64653954569627ad5413240cbd8453cd814;hp=64f90b7ba8b7fa1f5d96f40d8214822f7c47f780;hpb=58bb36d8ead1fe98acd7db18850eb215df7052e9;p=freeglut diff --git a/src/freeglut_input_devices.c b/src/freeglut_input_devices.c index 64f90b7..0dcb97f 100755 --- a/src/freeglut_input_devices.c +++ b/src/freeglut_input_devices.c @@ -36,7 +36,9 @@ #include "freeglut_internal.h" #if TARGET_HOST_POSIX_X11 +#if HAVE_ERRNO_H #include +#endif #include #include #include @@ -138,16 +140,8 @@ void fgInitialiseInputDevices ( void ) { if( !fgState.InputDevsInitialised ) { -#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher - char *dial_device=NULL; - 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]; @@ -164,9 +158,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;