- Using stderr or not is now a macro in error.h

This commit is contained in:
ccremers 2006-08-06 18:01:23 +00:00
parent a8b93c7bc4
commit 9683d76598
3 changed files with 7 additions and 4 deletions

View File

@ -14,10 +14,10 @@ error_die (void)
void void
vprintfstderr (char *fmt, va_list args) vprintfstderr (char *fmt, va_list args)
{ {
#ifdef linux #ifdef USESTDERR
vfprintf (stderr, fmt, args); vfprintf (stderr, fmt, args);
#else #else
// nothing for non-linux yet // no alternative yet
#endif #endif
} }

View File

@ -1,6 +1,9 @@
#ifndef ERROR #ifndef ERROR
#define ERROR #define ERROR
//! usestderr is defined iff we use it
#define USESTDERR
//! Types of exit codes //! Types of exit codes
enum exittypes enum exittypes
{ EXIT_NOATTACK = 0, EXIT_ERROR = 1, EXIT_NOCLAIM = 2, EXIT_ATTACK = 3 }; { EXIT_NOATTACK = 0, EXIT_ERROR = 1, EXIT_NOCLAIM = 2, EXIT_ATTACK = 3 };

View File

@ -318,10 +318,10 @@ getOutputStream (void)
if (globalError == 0) if (globalError == 0)
return (FILE *) globalStream; return (FILE *) globalStream;
else else
#ifdef linux #ifdef USESTDERR
return stderr; return stderr;
#else #else
// For non-linux, we simply omit it // we simply omit it
return NULL; return NULL;
#endif #endif
} }