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.
This commit is contained in:
yabause 2006-05-14 06:14:48 +00:00
parent a19d281580
commit a26856e8b1
1 changed files with 20 additions and 12 deletions

View File

@ -4,6 +4,10 @@
#include "types.h" #include "types.h"
#include <stdio.h> #include <stdio.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum { DEBUG_STRING, DEBUG_STREAM , DEBUG_STDOUT, DEBUG_STDERR } DebugOutType; typedef enum { DEBUG_STRING, DEBUG_STREAM , DEBUG_STDOUT, DEBUG_STDERR } DebugOutType;
typedef struct { typedef struct {
@ -28,39 +32,43 @@ void LogStart(void);
void LogStop(void); void LogStop(void);
#ifdef DEBUG #ifdef DEBUG
#define LOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) #define LOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else #else
#define LOG(f, ...) #define LOG(...)
#endif #endif
#ifdef GPUDEBUG #ifdef GPUDEBUG
#define GPULOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) #define GPULOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else #else
#define GPULOG(f, ...) #define GPULOG(...)
#endif #endif
#ifdef DIVDEBUG #ifdef DIVDEBUG
#define DIVLOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) #define DIVLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else #else
#define DIVLOG(f, ...) #define DIVLOG(...)
#endif #endif
#ifdef SQRTDEBUG #ifdef SQRTDEBUG
#define SQRTLOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) #define SQRTLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else #else
#define SQRTLOG(f, ...) #define SQRTLOG(...)
#endif #endif
#ifdef CARDDEBUG #ifdef CARDDEBUG
#define CARDLOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) #define CARDLOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else #else
#define CARDLOG(f, ...) #define CARDLOG(...)
#endif #endif
#ifdef DMADEBUG #ifdef DMADEBUG
#define DMALOG(f, ...) DebugPrintf(MainLog, __FILE__, __LINE__, f, __VA_ARGS__) #define DMALOG(...) DebugPrintf(MainLog, __FILE__, __LINE__, __VA_ARGS__)
#else #else
#define DMALOG(f, ...) #define DMALOG(...)
#endif
#ifdef __cplusplus
}
#endif #endif
#endif #endif