summaryrefslogtreecommitdiff
path: root/src/glut
diff options
context:
space:
mode:
authorJouk Jansen <joukj@hrem.stm.tudelft.nl>2001-02-09 12:19:17 +0000
committerJouk Jansen <joukj@hrem.stm.tudelft.nl>2001-02-09 12:19:17 +0000
commit18ce0f12540b016cbb08b7d304d80af0f7bb168b (patch)
tree63468a2e8bad2d913e30e64dfa82fdf2fbc3779c /src/glut
parent9db3f95acea5622573803890afd506ebcdaab3b3 (diff)
Committing in .
Modified Files: Mesa/src-glut/glut_event.c Mesa/src-glut/glut_get.c Mesa/src-glut/glut_init.c Mesa/src-glut/glutint.h Patch for compilation on very old VMS (version 6.2 and earlier) ----------------------------------------------------------------------
Diffstat (limited to 'src/glut')
-rw-r--r--src/glut/glx/glut_event.c30
-rw-r--r--src/glut/glx/glut_get.c8
-rw-r--r--src/glut/glx/glut_init.c22
-rw-r--r--src/glut/glx/glutint.h17
4 files changed, 57 insertions, 20 deletions
diff --git a/src/glut/glx/glut_event.c b/src/glut/glx/glut_event.c
index f4463dee0b6..d2c2c4810ff 100644
--- a/src/glut/glx/glut_event.c
+++ b/src/glut/glx/glut_event.c
@@ -64,18 +64,18 @@
# 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;
@@ -114,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;
@@ -156,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. */
@@ -839,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 */
@@ -851,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
diff --git a/src/glut/glx/glut_get.c b/src/glut/glx/glut_get.c
index e4117bdc86e..ecfd981ad9f 100644
--- a/src/glut/glx/glut_get.c
+++ b/src/glut/glx/glut_get.c
@@ -186,9 +186,13 @@ glutGet(GLenum param)
}
case GLUT_ELAPSED_TIME:
{
- struct timeval elapsed, beginning, now;
+#ifdef OLD_VMS
+ struct timeval6 elapsed, beginning, now;
+#else
+ struct timeval elapsed, beginning, now;
+#endif
- __glutInitTime(&beginning);
+ __glutInitTime(&beginning);
GETTIMEOFDAY(&now);
TIMEDELTA(elapsed, now, beginning);
/* Return elapsed milliseconds. */
diff --git a/src/glut/glx/glut_init.c b/src/glut/glx/glut_init.c
index d4d0e8a9783..dcd423a9417 100644
--- a/src/glut/glx/glut_init.c
+++ b/src/glut/glx/glut_init.c
@@ -154,11 +154,19 @@ __glutOpenXConnection(char *display)
#endif /* _WIN32 */
void
-__glutInitTime(struct timeval *beginning)
+#ifdef OLD_VMS
+ __glutInitTime(struct timeval6 *beginning)
+#else
+ __glutInitTime(struct timeval *beginning)
+#endif
{
static int beenhere = 0;
- static struct timeval genesis;
-
+#ifdef OLD_VMS
+ static struct timeval6 genesis;
+#else
+ static struct timeval genesis;
+#endif
+
if (!beenhere) {
GETTIMEOFDAY(&genesis);
beenhere = 1;
@@ -183,8 +191,12 @@ glutInit(int *argcp, char **argv)
{
char *display = NULL;
char *str, *geometry = NULL;
- struct timeval unused;
- int i;
+#ifdef OLD_VMS
+ struct timeval6 unused;
+#else
+ struct timeval unused;
+#endif
+ int i;
if (__glutDisplay) {
__glutWarning("glutInit being called a second time.");
diff --git a/src/glut/glx/glutint.h b/src/glut/glx/glutint.h
index 82e2465e81d..488ff5983ea 100644
--- a/src/glut/glx/glutint.h
+++ b/src/glut/glx/glutint.h
@@ -69,10 +69,11 @@
#ifdef __vms
#if ( __VMS_VER < 70000000 )
-struct timeval {
+#define OLD_VMS
+struct timeval6 {
__int64 val;
};
-extern int sys$gettim(struct timeval *);
+extern int sys$gettim(struct timeval6 *);
#else
#include <time.h>
#endif
@@ -530,8 +531,12 @@ struct _GLUTmenuItem {
typedef struct _GLUTtimer GLUTtimer;
struct _GLUTtimer {
GLUTtimer *next; /* list of timers */
- struct timeval timeout; /* time to be called */
- GLUTtimerCB func; /* timer (value) */
+#ifdef OLD_VMS
+ struct timeval6 timeout; /* time to be called */
+#else
+ struct timeval timeout; /* time to be called */
+#endif
+ GLUTtimerCB func; /* timer (value) */
int value; /* return value */
#ifdef SUPPORT_FORTRAN
GLUTtimerFCB ffunc; /* Fortran timer */
@@ -713,7 +718,11 @@ extern void __glutOpenXConnection(char *display);
#else
extern void __glutOpenWin32Connection(char *display);
#endif
+#if OLD_VMS
+extern void __glutInitTime(struct timeval6 *beginning);
+#else
extern void __glutInitTime(struct timeval *beginning);
+#endif
/* private routines for glut_menu.c (or win32_menu.c) */
#if defined(_WIN32)