#include <stdio.h>
#include <stdlib.h>
-#ifdef WIN32
-# include <windows.h>
-#else
+#ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
void xglutInit ( int* argcp, char** argv )
{
+ if(!xglTraceFd ) { // Not defined by any other means, must be here
+ xglTraceFd = stdout; // avoid a crash from a NULL ptr.
+ }
if ( xglTraceIsEnabled("glutInit") )
- fprintf ( xglTraceFd, " /* glutInit ( (int *)0x%08x, (char **)0x%08x ) ; */\n" , argcp, argv ) ;
+ fprintf ( xglTraceFd,
+ " /* glutInit ( (int *)0x%08x, (char **)0x%08x ) ; */\n" ,
+ argcp, argv ) ;
if ( xglExecuteIsEnabled("glutInit") )
glutInit ( argcp, argv ) ;
}