Mercurial > hg > openttd
changeset 5384:8d01a08502fc draft
(svn r7571) -Fix (r7565): Older GCC versions do not have __VA_ARGS__ support (C99), work around
this (tokai)
author | Darkvater <Darkvater@openttd.org> |
---|---|
date | Wed, 27 Dec 2006 12:22:25 +0000 |
parents | 2a31a9428c08 |
children | a7eef6b5fd68 |
files | debug.h |
diffstat | 1 files changed, 5 insertions(+), 1 deletions(-) [+] |
line wrap: on
line diff
--- a/debug.h +++ b/debug.h @@ -20,7 +20,11 @@ #ifdef NO_DEBUG_MESSAGES #define DEBUG(name, level, ...) #else - #define DEBUG(name, level, ...) if (level == 0 || _debug_ ## name ## _level >= level) debug(#name, __VA_ARGS__) + #if defined(__GNUC__) && (__GNUC__ < 3) + #define DEBUG(name, level, args...) if ((level == 0) || ( _debug_ ## name ## _level >= level)) debug(#name, args) + #else + #define DEBUG(name, level, ...) if (level == 0 || _debug_ ## name ## _level >= level) debug(#name, __VA_ARGS__) + #endif extern int _debug_ai_level; extern int _debug_driver_level;