aboutsummaryrefslogtreecommitdiffstats
path: root/Alc/logging.h
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2019-01-07 01:13:06 -0800
committerChris Robinson <[email protected]>2019-01-07 01:13:06 -0800
commit67c9cf81748422b6a96945c6e0508a61f83f12f6 (patch)
tree5ecf96a0920470748567fafe1de4ba27ac5b7690 /Alc/logging.h
parent648b76ed656267a46f4e8513a04de285f6d5053d (diff)
Define logging calls to be unlikely
Diffstat (limited to 'Alc/logging.h')
-rw-r--r--Alc/logging.h10
1 files changed, 6 insertions, 4 deletions
diff --git a/Alc/logging.h b/Alc/logging.h
index ae70e598..6c2c1c94 100644
--- a/Alc/logging.h
+++ b/Alc/logging.h
@@ -3,6 +3,8 @@
#include <stdio.h>
+#include "opthelpers.h"
+
#if defined(_WIN64)
#define SZFMT "%I64u"
@@ -46,24 +48,24 @@ enum LogLevel {
extern LogLevel gLogLevel;
#define TRACEREF(...) do { \
- if(gLogLevel >= LogRef) \
+ if(UNLIKELY(gLogLevel >= LogRef)) \
AL_PRINT("(--)", __VA_ARGS__); \
} while(0)
#define TRACE(...) do { \
- if(gLogLevel >= LogTrace) \
+ if(UNLIKELY(gLogLevel >= LogTrace)) \
AL_PRINT("(II)", __VA_ARGS__); \
LOG_ANDROID(ANDROID_LOG_DEBUG, __VA_ARGS__); \
} while(0)
#define WARN(...) do { \
- if(gLogLevel >= LogWarning) \
+ if(UNLIKELY(gLogLevel >= LogWarning)) \
AL_PRINT("(WW)", __VA_ARGS__); \
LOG_ANDROID(ANDROID_LOG_WARN, __VA_ARGS__); \
} while(0)
#define ERR(...) do { \
- if(gLogLevel >= LogError) \
+ if(UNLIKELY(gLogLevel >= LogError)) \
AL_PRINT("(EE)", __VA_ARGS__); \
LOG_ANDROID(ANDROID_LOG_ERROR, __VA_ARGS__); \
} while(0)