Fixing "freeglut_input_devices.c" for MSVS2005 and later per e-mail from Diederick Niehorster dated Thu 3/19/2009 6:57 AM

git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@805 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
fayjf 2009-03-19 14:55:14 +00:00
parent 7ee6e9ee86
commit b8bb61e933

View File

@ -136,15 +136,16 @@ int fgInputDeviceDetect( void )
*/ */
void fgInitialiseInputDevices ( void ) void fgInitialiseInputDevices ( void )
{ {
const char *dial_device=NULL;
if( !fgState.InputDevsInitialised ) if( !fgState.InputDevsInitialised )
{ {
#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher #if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) // will return true for VC8 (VC2005) and higher
char *dial_device=NULL;
size_t sLen; size_t sLen;
errno_t err = _dupenv_s( &dial_device, &sLen, "GLUT_DIALS_SERIAL" ); errno_t err = _dupenv_s( &dial_device, &sLen, "GLUT_DIALS_SERIAL" );
if (err) if (err)
fgError("Error getting GLUT_DIALS_SERIAL environment variable"); fgError("Error getting GLUT_DIALS_SERIAL environment variable");
#else #else
const char *dial_device=NULL;
dial_device = getenv ( "GLUT_DIALS_SERIAL" ); dial_device = getenv ( "GLUT_DIALS_SERIAL" );
#endif #endif
#if TARGET_HOST_MS_WINDOWS #if TARGET_HOST_MS_WINDOWS