# Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS([GL/gl.h GL/glu.h GL/glx.h fcntl.h sys/ioctl.h sys/time.h])
+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_HEADER_TIME
save_CFLAGS="$CFLAGS"
* Many thanks for Steve Baker for permission to pull from that library.
*/
-#if defined( __FreeBSD__ ) || defined( __NetBSD__ )
-# include <sys/param.h>
-#endif
-
#include <GL/freeglut.h>
#include "freeglut_internal.h"
+#if HAVE_SYS_PARAM_H
+# include <sys/param.h>
+#endif
/*
* Initial defines from "js.h" starting around line 33 with the existing "freeglut_joystick.c"
#include <GL/freeglut.h>
#include "freeglut_internal.h"
-#include <limits.h>
#if TARGET_HOST_UNIX_X11
#include <errno.h>
#include <sys/stat.h>
#endif
-#ifndef MAX
-#define MAX(a,b) (((a)>(b)) ? (a) : (b))
+/*
+ * Try to get the maximum value allowed for ints, falling back to the minimum
+ * guaranteed by ISO C99 if there is no suitable header.
+ */
+#if HAVE_LIMITS_H
+# include <limits.h>
+#endif
+#ifndef INT_MAX
+# define INT_MAX 32767
#endif
#ifndef MIN
return;
msec = fghNextTimer( );
- if( fghHaveJoystick( ) ) /* XXX Use GLUT timers for joysticks... */
- msec = MIN( msec, 10 ); /* XXX Dumb; forces granularity to .01sec */
+ /* XXX Use GLUT timers for joysticks... */
+ /* XXX Dumb; forces granularity to .01sec */
+ if( fghHaveJoystick( ) && ( msec < 10 ) )
+ msec = 10;
#if TARGET_HOST_UNIX_X11
/*