added glutGetProcAddress() and GLUT_FPS env var option
[mesa.git] / src / glut / glx / glut_event.c
index d10cc159b618cda261ed4d859e290080ad67bc53..d2c2c4810ff916fbf181807aebbd24fcfaefc91c 100644 (file)
@@ -5,6 +5,10 @@
    and is provided without guarantee or warrantee expressed or
    implied. This program is -not- in the public domain. */
 
+#ifdef __VMS
+#include <GL/vms_x_fix.h>
+#endif
+
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
 # endif
 #endif /* !_WIN32 */
 
+#include "glutint.h"
+
 #if defined(__vms) && ( __VMS_VER < 70000000 )
 #include <ssdef.h>
 #include <psldef.h>
 extern int SYS$CLREF(int efn);
-extern int SYS$SETIMR(unsigned int efn, struct timeval *timeout, void *ast,
+extern int SYS$SETIMR(unsigned int efn, struct timeval6 *timeout, void *ast,
   unsigned int request_id, unsigned int flags);
 extern int SYS$WFLOR(unsigned int efn, unsigned int mask);
 extern int SYS$CANTIM(unsigned int request_id, unsigned int mode);
 #endif /* __vms, VMs 6.2 or earlier */
 
-#include "glutint.h"
-
 static GLUTtimer *freeTimerList = NULL;
 
 GLUTidleCB __glutIdleFunc = NULL;
@@ -110,8 +114,12 @@ glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value)
 {
   GLUTtimer *timer, *other;
   GLUTtimer **prevptr;
-  struct timeval now;
-
+#ifdef OLD_VMS
+   struct timeval6 now;
+#else
+   struct timeval now;
+#endif
+   
   if (!timerFunc)
     return;
 
@@ -152,8 +160,12 @@ glutTimerFunc(unsigned int interval, GLUTtimerCB timerFunc, int value)
 void
 handleTimeouts(void)
 {
-  struct timeval now;
-  GLUTtimer *timer;
+#ifdef OLD_VMS
+   struct timeval6 now;
+#else
+   struct timeval now;
+#endif
+   GLUTtimer *timer;
 
   /* Assumption is that __glutTimerList is already determined
      to be non-NULL. */
@@ -302,17 +314,16 @@ interruptibleXNextEvent(Display * dpy, XEvent * event)
       return 1;
     }
 #ifndef VMS
-     /* the combination ConectionNumber-select is buggy on VMS. Sometimes it
-      * fails. This part of the code hangs the program on VMS7.2. But even
-      * without it the program seems to run correctly.
-      * Note that this is a bug in the VMS/DECWindows run-time-libraries.
-      * Compaq engeneering does not want or is not able to make a fix.
-      * (last sentence is a quotation from Compaq when I reported the
-      * problem January 2000) */
-     FD_ZERO(&fds);
+    /* the combination ConectionNumber-select is buggy on VMS. Sometimes it
+     * fails. This part of the code hangs the program on VMS7.2. But even
+     * without it the program seems to run correctly.
+     * Note that this is a bug in the VMS/DECWindows run-time-libraries.
+     * Compaq engeneering does not want or is not able to make a fix.
+     * (last sentence is a quotation from Compaq when I reported the
+     * problem January 2000) */
+    FD_ZERO(&fds);
     FD_SET(__glutConnectionFD, &fds);
-    rc = select(__glutConnectionFD + 1, &fds,
-      NULL, NULL, NULL);
+    rc = select(__glutConnectionFD + 1, &fds, NULL, NULL, NULL);
     if (rc < 0) {
       if (errno == EINTR) {
         return 0;
@@ -836,7 +847,7 @@ static void
 waitForSomething(void)
 {
 #if defined(__vms) && ( __VMS_VER < 70000000 )
-  static struct timeval zerotime =
+  static struct timeval6 zerotime =
   {0};
   unsigned int timer_efn;
 #define timer_id 'glut' /* random :-) number */
@@ -848,7 +859,11 @@ waitForSomething(void)
   fd_set fds;
 #endif
 #endif
-  struct timeval now, timeout, waittime;
+#ifdef OLD_VMS
+   struct timeval6 now, timeout, waittime;
+#else
+   struct timeval now, timeout, waittime;
+#endif
 #if !defined(_WIN32)
   int rc;
 #endif