From a26856e8b10b210b2e7b136a55db235a9b0403c0 Mon Sep 17 00:00:00 2001 From: yabause Date: Sun, 14 May 2006 06:14:48 +0000 Subject: [PATCH] Fixed debug.h so variadic macros are working without arguments and added an extern "C" so there's no linker error when using autotools script to compile. --- desmume/src/debug.h | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/desmume/src/debug.h b/desmume/src/debug.h index f4aa01022..9f9224615 100644 --- a/desmume/src/debug.h +++ b/desmume/src/debug.h @@ -4,6 +4,10 @@ #include "types.h" #include +#ifdef __cplusplus +extern "C" { +#endif + typedef enum { DEBUG_STRING, DEBUG_STREAM , DEBUG_STDOUT, DEBUG_STDERR } DebugOutType; typedef struct { @@ -28,39 +32,43 @@ void LogStart(void); void LogStop(void); #ifdef DEBUG -#define LOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) +#define LOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else -#define LOG(f, ...) +#define LOG(...) #endif #ifdef GPUDEBUG -#define GPULOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) +#define GPULOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else -#define GPULOG(f, ...) +#define GPULOG(...) #endif #ifdef DIVDEBUG -#define DIVLOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) +#define DIVLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else -#define DIVLOG(f, ...) +#define DIVLOG(...) #endif #ifdef SQRTDEBUG -#define SQRTLOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) +#define SQRTLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else -#define SQRTLOG(f, ...) +#define SQRTLOG(...) #endif #ifdef CARDDEBUG -#define CARDLOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) +#define CARDLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else -#define CARDLOG(f, ...) +#define CARDLOG(...) #endif #ifdef DMADEBUG -#define DMALOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) +#define DMALOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__) #else -#define DMALOG(f, ...) +#define DMALOG(...) +#endif + +#ifdef __cplusplus +} #endif #endif