/>\r
<Tool\r
Name="VCCLCompilerTool"\r
- AdditionalOptions="/D "_CRT_SECURE_CPP_OVERLOAD_STANDARD_NAMES""\r
Optimization="0"\r
AdditionalIncludeDirectories="..\include"\r
- PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;FREEGLUT_EXPORTS"\r
+ PreprocessorDefinitions="_DEBUG;WIN32;_WINDOWS;_USRDLL;FREEGLUT_EXPORTS;_CRT_SECURE_NO_WARNINGS"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
RuntimeLibrary="1"\r
Optimization="2"\r
EnableIntrinsicFunctions="true"\r
AdditionalIncludeDirectories="..\include"\r
- PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;FREEGLUT_EXPORTS"\r
+ PreprocessorDefinitions="NDEBUG;WIN32;_WINDOWS;_USRDLL;FREEGLUT_EXPORTS;_CRT_SECURE_NO_WARNINGS"\r
RuntimeLibrary="0"\r
EnableFunctionLevelLinking="true"\r
WarningLevel="3"\r
Name="VCCLCompilerTool"\r
Optimization="0"\r
AdditionalIncludeDirectories="..\include"\r
- PreprocessorDefinitions="_DEBUG;FREEGLUT_STATIC;WIN32;_LIB"\r
+ PreprocessorDefinitions="_DEBUG;FREEGLUT_STATIC;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS"\r
MinimalRebuild="true"\r
BasicRuntimeChecks="3"\r
RuntimeLibrary="1"\r
Optimization="2"\r
InlineFunctionExpansion="1"\r
AdditionalIncludeDirectories="..\include"\r
- PreprocessorDefinitions="NDEBUG;FREEGLUT_STATIC;WIN32;_LIB"\r
+ PreprocessorDefinitions="NDEBUG;FREEGLUT_STATIC;WIN32;_LIB;_CRT_SECURE_NO_WARNINGS"\r
StringPooling="true"\r
RuntimeLibrary="0"\r
EnableFunctionLevelLinking="true"\r
AC_HEADER_STDC
save_CPPFLAGS="$CPPFLAGS"
CPPFLAGS="$CPPFLAGS $X_CFLAGS"
-AC_CHECK_HEADERS([GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
+AC_CHECK_HEADERS([usbhid.h errno.h GL/gl.h GL/glu.h GL/glx.h fcntl.h limits.h sys/ioctl.h sys/param.h sys/time.h])
AC_HEADER_TIME
AC_CHECK_HEADERS([X11/extensions/xf86vmode.h], [], [], [#include <X11/Xlib.h>])
AC_CHECK_HEADERS([X11/extensions/XI.h X11/extensions/XInput.h])
char* geometry = NULL;
int i, j, argc = *pargc;
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
- size_t sLen;
-#if HAVE_ERRNO
- errno_t err;
-#endif
-#endif
-
if( fgState.Initialised )
fgError( "illegal glutInit() reinitialization attempt" );
/* check if GLUT_FPS env var is set */
#ifndef _WIN32_WCE
{
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
- char* fps = NULL;
- err = _dupenv_s( &fps, &sLen, "GLUT_FPS" );
- if (err)
- fgError("Error getting GLUT_FPS environment variable");
-#else
const char *fps = getenv( "GLUT_FPS" );
-#endif
+
if( fps )
{
int interval;
else
fgState.FPSInterval = interval;
}
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
- free ( fps ); fps = NULL; /* dupenv_s allocates a string that we must free */
-#endif
}
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
- err = _dupenv_s( &displayName, &sLen, "DISPLAY" );
- if (err)
- fgError("Error getting DISPLAY environment variable");
-#else
displayName = getenv( "DISPLAY" );
-#endif
for( i = 1; i < argc; i++ )
{
* variable for opening the X display (see code above):
*/
fghInitialize( displayName );
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
- free ( displayName ); displayName = NULL; /* dupenv_s allocates a string that we must free */
-#endif
/*
* Geometry parsing deffered until here because we may need the screen
* delimited by blanks or tabs.
*/
char *token ;
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
- char *next_token = NULL;
-#endif
size_t len = strlen ( displayMode );
char *buffer = (char *)malloc ( (len+1) * sizeof(char) );
memcpy ( buffer, displayMode, len );
buffer[len] = '\0';
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
- token = strtok_s ( buffer, " \t", &next_token );
-#else
token = strtok ( buffer, " \t" );
-#endif
+
while ( token )
{
/* Process this token */
break ;
}
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 )
- token = strtok_s ( NULL, " \t", &next_token );
-#else
token = strtok ( NULL, " \t" );
-#endif
}
free ( buffer );
#include "freeglut_internal.h"
#if TARGET_HOST_POSIX_X11
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
#include <errno.h>
#endif
#include <sys/ioctl.h>
{
if( !fgState.InputDevsInitialised )
{
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
- 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];
#endif
if ( !dial_device ) return;
if ( !( dialbox_port = serial_open ( dial_device ) ) ) return;
- /* will return true for VC8 (VC2005) and higher */
-#if TARGET_HOST_MS_WINDOWS && ( _MSC_VER >= 1400 ) && HAVE_ERRNO
- 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;
# if HAVE_FCNTL_H
# include <fcntl.h>
# endif
-# if HAVE_ERRNO
+# if HAVE_ERRNO_H
# include <errno.h>
# endif
# if defined(__FreeBSD__) || defined(__NetBSD__)
if (cp)
return 1;
}
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
else if (errno == EACCES) {
if (!protection_warned) {
fgWarning ( "Can't open %s for read!", buf );
if ( ( rd = hid_get_report_desc( os->fd ) ) == 0 )
{
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
fgWarning ( "error: %s: %s", os->fname, strerror( errno ) );
#else
fgWarning ( "error: %s", os->fname );
if( ioctl( os->fd, USB_GET_REPORT_ID, &report_id ) < 0)
{
/*** XXX {report_id} may not be the right variable? ***/
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) );
#else
fgWarning ( "error: %s%d", UHIDDEV, report_id );
}
}
}
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
if ( len < 0 && errno != EAGAIN )
#else
if ( len < 0 )
if ( status != sizeof( struct js_event ) )
{
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
if ( errno == EAGAIN )
{
/* Use the old values */
joy->os->fd = open( joy->os->fname, O_RDONLY | O_NONBLOCK);
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
if( joy->os->fd < 0 && errno == EACCES )
fgWarning ( "%s exists but is not readable by you", joy->os->fname );
#endif
#include <GL/freeglut.h>
#include "freeglut_internal.h"
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
# include <errno.h>
#endif
#include <stdarg.h>
wait.tv_usec = (msec % 1000) * 1000;
err = select( socket+1, &fdset, NULL, NULL, &wait );
-#if HAVE_ERRNO
+#if HAVE_ERRNO_H
if( ( -1 == err ) && ( errno != EINTR ) )
fgWarning ( "freeglut select() error: %d", errno );
#endif
#include <stdio.h>\r
#include <stdlib.h>\r
#include <string.h>\r
+\r
+#if HAVE_ERRNO_H\r
#include <errno.h>\r
+#endif\r
\r
#include <X11/Xlib.h>\r
#include <X11/Xutil.h>\r