diff options
Diffstat (limited to 'src/3rdparty/angle/src/common/debug.h')
-rw-r--r-- | src/3rdparty/angle/src/common/debug.h | 32 |
1 files changed, 18 insertions, 14 deletions
diff --git a/src/3rdparty/angle/src/common/debug.h b/src/3rdparty/angle/src/common/debug.h index 23ee26d23b..793843895c 100644 --- a/src/3rdparty/angle/src/common/debug.h +++ b/src/3rdparty/angle/src/common/debug.h @@ -39,33 +39,35 @@ namespace gl } // A macro to output a trace of a function call and its arguments to the debugging log -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define TRACE(message, ...) (void(0)) -#else +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #define TRACE(message, ...) gl::trace(true, "trace: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define TRACE(message, ...) (void(0)) #endif // A macro to output a function call and its arguments to the debugging log, to denote an item in need of fixing. -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define FIXME(message, ...) (void(0)) -#else +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #define FIXME(message, ...) gl::trace(false, "fixme: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define FIXME(message, ...) (void(0)) #endif // A macro to output a function call and its arguments to the debugging log, in case of error. -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define ERR(message, ...) (void(0)) -#else +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) #define ERR(message, ...) gl::trace(false, "err: %s(%d): " message "\n", __FUNCTION__, __LINE__, ##__VA_ARGS__) +#else +#define ERR(message, ...) (void(0)) #endif // A macro to log a performance event around a scope. -#if defined(ANGLE_DISABLE_TRACE) && defined(ANGLE_DISABLE_PERF) -#define EVENT(message, ...) (void(0)) -#elif defined(_MSC_VER) +#if defined(ANGLE_ENABLE_TRACE) || defined(ANGLE_ENABLE_PERF) +#if defined(_MSC_VER) #define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper ## __LINE__(__FUNCTION__ message "\n", __VA_ARGS__); #else #define EVENT(message, ...) gl::ScopedPerfEventHelper scopedPerfEventHelper(message "\n", ##__VA_ARGS__); +#endif // _MSC_VER +#else +#define EVENT(message, ...) (void(0)) #endif // A macro asserting a condition and outputting failures to the debug log @@ -99,8 +101,10 @@ namespace gl #define UNREACHABLE() ERR("\t! Unreachable reached: %s(%d)\n", __FUNCTION__, __LINE__) #endif -// A macro that determines whether an object has a given runtime type. -#if !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) +// A macro that determines whether an object has a given runtime type. MSVC uses _CPPRTTI. +// GCC uses __GXX_RTTI, but the macro was introduced in version 4.3, so we assume that all older +// versions support RTTI. +#if !defined(NDEBUG) && (!defined(_MSC_VER) || defined(_CPPRTTI)) && (!defined(__GNUC__) || __GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3) || defined(__GXX_RTTI)) #define HAS_DYNAMIC_TYPE(type, obj) (dynamic_cast<type >(obj) != NULL) #else #define HAS_DYNAMIC_TYPE(type, obj) true |