#
# Additional linker flags
#
-lib@LIBRARY@_la_LIBADD = $(LIBM) $(X_LIBS) $(GL_LIBS) $(LIBXXF86VM) $(LIBXI)
+lib@LIBRARY@_la_LIBADD = $(GL_LIBS) $(X_LIBS) $(LIBM)
lib@LIBRARY@_la_LDFLAGS = $(VERSION_INFO) -no-undefined
-lib@LIBRARY@_la_CFLAGS = $(X_CFLAGS) $(EXPORT_FLAGS)
+lib@LIBRARY@_la_CFLAGS = $(GL_FLAGS) $(X_CFLAGS) $(EXPORT_FLAGS)
lib@LIBRARY@_la_CPPFLAGS= -I$(top_srcdir)/include
#
#include "freeglut_internal.h"
#if TARGET_HOST_POSIX_X11
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
#include <sys/ioctl.h>
-#include <sys/time.h>
-#include <time.h>
#include <stdio.h>
#include <stdlib.h>
-#include <unistd.h>
#include <string.h>
#include <termios.h>
#include <fcntl.h>
-#include <sys/types.h>
typedef struct {
int fd;
#ifndef FREEGLUT_INTERNAL_H
#define FREEGLUT_INTERNAL_H
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
# include "config.h"
#endif
/* XXX: Don't all MS-Windows compilers (except Cygwin) have _WIN32 defined?
* XXX: If so, remove the first set of defined()'s below.
*/
+#if !defined(TARGET_HOST_POSIX_X11) && !defined(TARGET_HOST_MS_WINDOWS) && !defined(TARGET_HOST_MAC_OSX)
#if defined(_MSC_VER) || defined(__WATCOMC__) || defined(__MINGW32__) \
|| defined(_WIN32) || defined(_WIN32_WCE) \
|| ( defined(__CYGWIN__) && defined(X_DISPLAY_MISSING) )
# error "Unrecognized target host!"
*/
#endif
+#endif
/* Detect both SunPro and gcc compilers on Sun Solaris */
#if defined (__SVR4) && defined (__sun)
# include <X11/Xatom.h>
# include <X11/keysym.h>
# include <X11/extensions/XInput.h>
-# ifdef HAVE_X11_EXTENSIONS_XF86VMODE_H
+# ifdef HAVE_XXF86VM
# include <X11/extensions/xf86vmode.h>
# endif
/* If GLX is too old, we will fail during runtime when multisampling
#include <stdlib.h>
/* These are included based on autoconf directives. */
-#if HAVE_SYS_TYPES_H
+#ifdef HAVE_SYS_TYPES_H
# include <sys/types.h>
#endif
-#if HAVE_UNISTD_H
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
-#if TIME_WITH_SYS_TIME
+#ifdef TIME_WITH_SYS_TIME
# include <sys/time.h>
# include <time.h>
-#elif HAVE_SYS_TIME_H
+#elif defined(HAVE_SYS_TIME_H)
# include <sys/time.h>
#else
# include <time.h>
# endif
#endif
-#if TARGET_HOST_MS_WINDOWS
-# define HAVE_VPRINTF 1
-#endif
-
-#if !defined(HAVE_VPRINTF) && !defined(HAVE_DOPRNT)
-/* XXX warning directive here? */
-# define HAVE_VPRINTF 1
-#endif
-
/* MinGW may lack a prototype for ChangeDisplaySettingsEx() (depending on the version?) */
#if TARGET_HOST_MS_WINDOWS && !defined(ChangeDisplaySettingsEx)
LONG WINAPI ChangeDisplaySettingsExA(LPCSTR,LPDEVMODEA,HWND,DWORD,LPVOID);
# define M_PI 3.14159265358979323846
#endif
-#ifndef TRUE
-# define TRUE 1
-#endif
-
-#ifndef FALSE
-# define FALSE 0
+#ifdef HAVE_STDBOOL_H
+# include <stdbool.h>
+# ifndef TRUE
+# define TRUE true
+# endif
+# ifndef FALSE
+# define FALSE false
+# endif
+#else
+# ifndef TRUE
+# define TRUE 1
+# endif
+# ifndef FALSE
+# define FALSE 0
+# endif
#endif
/* General defines */
#include <GL/freeglut.h>
#include "freeglut_internal.h"
-#if HAVE_SYS_PARAM_H
+#ifdef HAVE_SYS_PARAM_H
# include <sys/param.h>
#endif
#if TARGET_HOST_POSIX_X11
# define _JS_MAX_AXES 16
-# if HAVE_SYS_IOCTL_H
+# ifdef HAVE_SYS_IOCTL_H
# include <sys/ioctl.h>
# endif
-# if HAVE_FCNTL_H
+# ifdef HAVE_FCNTL_H
# include <fcntl.h>
# endif
-# if HAVE_ERRNO_H
+# ifdef HAVE_ERRNO_H
# include <errno.h>
+# include <string.h>
# endif
# if defined(__FreeBSD__) || defined(__NetBSD__)
/* XXX The below hack is done until freeglut's autoconf is updated. */
if (cp)
return 1;
}
-#if HAVE_ERRNO_H
+#ifdef 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_H
+#ifdef 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_H
+#ifdef HAVE_ERRNO_H
fgWarning ( "error: %s%d: %s", UHIDDEV, report_id, strerror( errno ) );
#else
fgWarning ( "error: %s%d", UHIDDEV, report_id );
}
}
}
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
if ( len < 0 && errno != EAGAIN )
#else
if ( len < 0 )
if ( status != sizeof( struct js_event ) )
{
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
if ( errno == EAGAIN )
{
/* Use the old values */
joy->os->fd = open( joy->os->fname, O_RDONLY | O_NONBLOCK);
-#if HAVE_ERRNO_H
+#ifdef 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_H
+#ifdef HAVE_ERRNO_H
# include <errno.h>
#endif
#include <stdarg.h>
-#if HAVE_VPRINTF
+#ifdef HAVE_VFPRINTF
# define VFPRINTF(s,f,a) vfprintf((s),(f),(a))
-#elif HAVE_DOPRNT
+#elif defined(HAVE__DOPRNT)
# define VFPRINTF(s,f,a) _doprnt((f),(a),(s))
#else
# define VFPRINTF(s,f,a)
* 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
+#ifdef HAVE_LIMITS_H
# include <limits.h>
#endif
#ifndef INT_MAX
wait.tv_usec = (msec % 1000) * 1000;
err = select( socket+1, &fdset, NULL, NULL, &wait );
-#if HAVE_ERRNO_H
+#ifdef HAVE_ERRNO_H
if( ( -1 == err ) && ( errno != EINTR ) )
fgWarning ( "freeglut select() error: %d", errno );
#endif