From: Sven Panne Date: Mon, 3 Jan 2005 12:02:42 +0000 (+0000) Subject: autoconf'd vfprintf X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=commitdiff_plain;h=3d093218232559989253aaa1f22c5e1523e0c811;p=freeglut autoconf'd vfprintf git-svn-id: svn+ssh://svn.code.sf.net/p/freeglut/code/trunk/freeglut/freeglut@555 7f0cb862-5218-0410-a997-914c9d46530a --- diff --git a/configure.ac b/configure.ac index aa4e304..45ba8cc 100644 --- a/configure.ac +++ b/configure.ac @@ -33,6 +33,7 @@ CFLAGS="$save_CFLAGS" # Checks for library functions. AC_PROG_GCC_TRADITIONAL +AC_FUNC_VPRINTF AC_CHECK_LIBM AC_SUBST([LIBM]) diff --git a/src/freeglut_internal.h b/src/freeglut_internal.h index c0317d9..a6a4a76 100644 --- a/src/freeglut_internal.h +++ b/src/freeglut_internal.h @@ -73,7 +73,6 @@ #include #include #include -#include #if HAVE_SYS_TYPES_H # include #endif diff --git a/src/freeglut_main.c b/src/freeglut_main.c index 61731cb..d1ba612 100644 --- a/src/freeglut_main.c +++ b/src/freeglut_main.c @@ -30,6 +30,14 @@ #if HAVE_ERRNO_H # include #endif +#include +#if HAVE_VPRINTF +# define VFPRINTF(s,f,a) vfprintf((s),(f),(a)) +#elif HAVE_DOPRNT +# define VFPRINTF(s,f,a) _doprnt((f),(a),(s)) +#else +# define VFPRINTF(s,f,a) +#endif #if TARGET_HOST_WINCE @@ -348,8 +356,8 @@ void fgError( const char *fmt, ... ) fprintf( stderr, "freeglut "); if( fgState.ProgramName ) - fprintf (stderr, "(%s): ", fgState.ProgramName); - vfprintf( stderr, fmt, ap ); + fprintf( stderr, "(%s): ", fgState.ProgramName ); + VFPRINTF( stderr, fmt, ap ); fprintf( stderr, "\n" ); va_end( ap ); @@ -369,7 +377,7 @@ void fgWarning( const char *fmt, ... ) fprintf( stderr, "freeglut "); if( fgState.ProgramName ) fprintf( stderr, "(%s): ", fgState.ProgramName ); - vfprintf( stderr, fmt, ap ); + VFPRINTF( stderr, fmt, ap ); fprintf( stderr, "\n" ); va_end( ap );