autoconf'd <limits.h> and <sys/param.h> handling, removing MIN/MAX

macros on the way.


git-svn-id: https://svn.code.sf.net/p/freeglut/code/trunk@552 7f0cb862-5218-0410-a997-914c9d46530a
This commit is contained in:
spanne 2005-01-03 11:22:59 +00:00
parent a425a411af
commit 3817d97ab7
3 changed files with 17 additions and 10 deletions

View File

@ -23,7 +23,7 @@ AC_SUBST([LIBXXF86VM])
# Checks for header files. # Checks for header files.
AC_HEADER_STDC 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 AC_HEADER_TIME
save_CFLAGS="$CFLAGS" save_CFLAGS="$CFLAGS"

View File

@ -31,12 +31,11 @@
* Many thanks for Steve Baker for permission to pull from that library. * 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 <GL/freeglut.h>
#include "freeglut_internal.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" * Initial defines from "js.h" starting around line 33 with the existing "freeglut_joystick.c"

View File

@ -28,7 +28,6 @@
#include <GL/freeglut.h> #include <GL/freeglut.h>
#include "freeglut_internal.h" #include "freeglut_internal.h"
#include <limits.h>
#if TARGET_HOST_UNIX_X11 #if TARGET_HOST_UNIX_X11
#include <errno.h> #include <errno.h>
#include <sys/stat.h> #include <sys/stat.h>
@ -49,8 +48,15 @@ struct GXKeyList gxKeyList;
#endif #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 #endif
#ifndef MIN #ifndef MIN
@ -445,8 +451,10 @@ static void fghSleepForEvents( void )
return; return;
msec = fghNextTimer( ); msec = fghNextTimer( );
if( fghHaveJoystick( ) ) /* XXX Use GLUT timers for joysticks... */ /* XXX Use GLUT timers for joysticks... */
msec = MIN( msec, 10 ); /* XXX Dumb; forces granularity to .01sec */ /* XXX Dumb; forces granularity to .01sec */
if( fghHaveJoystick( ) && ( msec < 10 ) )
msec = 10;
#if TARGET_HOST_UNIX_X11 #if TARGET_HOST_UNIX_X11
/* /*