2 * Copyright 1994-1997 Mark Kilgard, All rights reserved.
3 * Distributed under the terms of the MIT License.
18 /* strdup is actually not a standard ANSI C or POSIX routine
19 so implement a private one for GLUT. OpenVMS does not have a
20 strdup; Linux's standard libc doesn't declare strdup by default
21 (unless BSD or SVID interfaces are requested). */
23 __glutStrdup(const char *string
)
27 copy
= (char*) malloc(strlen(string
) + 1);
35 __glutWarning(const char *format
,...)
39 va_start(args
, format
);
40 fprintf(stderr
, "GLUT: Warning in %s: ",
41 __glutProgramName
? __glutProgramName
: "(unamed)");
42 vfprintf(stderr
, format
, args
);
49 glutReportErrors(void)
53 while ((error
= glGetError()) != GL_NO_ERROR
)
54 __glutWarning("GL error: %s", gluErrorString(error
));
59 __glutFatalError(const char *format
,...)
63 va_start(args
, format
);
64 fprintf(stderr
, "GLUT: Fatal Error in %s: ",
65 __glutProgramName
? __glutProgramName
: "(unamed)");
66 vfprintf(stderr
, format
, args
);
73 __glutFatalUsage(const char *format
,...)
77 va_start(args
, format
);
78 fprintf(stderr
, "GLUT: Fatal API Usage in %s: ",
79 __glutProgramName
? __glutProgramName
: "(unamed)");
80 vfprintf(stderr
, format
, args
);