summaryrefslogtreecommitdiffstats
path: root/src/Globals.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/Globals.h')
-rw-r--r--src/Globals.h32
1 files changed, 31 insertions, 1 deletions
diff --git a/src/Globals.h b/src/Globals.h
index de1024010..0926457da 100644
--- a/src/Globals.h
+++ b/src/Globals.h
@@ -162,8 +162,17 @@ template class SizeChecker<UInt16, 2>;
TypeName(const TypeName &); \
void operator =(const TypeName &)
+// A macro that is used to mark unused local variables, to avoid pedantic warnings in gcc / clang / MSVC
+// Note that in MSVC it requires the full type of X to be known
+#define UNUSED_VAR(X) (void)(X)
+
// A macro that is used to mark unused function parameters, to avoid pedantic warnings in gcc
-#define UNUSED(X) (void)(X)
+// Written so that the full type of param needn't be known
+#ifdef _MSC_VER
+ #define UNUSED(X)
+#else
+ #define UNUSED UNUSED_VAR
+#endif
@@ -261,6 +270,27 @@ void inline LOGERROR(const char* a_Format, ...)
vprintf(a_Format, argList);
va_end(argList);
}
+
+void inline LOGWARNING(const char* a_Format, ...) FORMATSTRING(1, 2);
+
+void inline LOGWARNING(const char* a_Format, ...)
+{
+ va_list argList;
+ va_start(argList, a_Format);
+ vprintf(a_Format, argList);
+ va_end(argList);
+}
+
+void inline LOGD(const char* a_Format, ...) FORMATSTRING(1, 2);
+
+void inline LOGD(const char* a_Format, ...)
+{
+ va_list argList;
+ va_start(argList, a_Format);
+ vprintf(a_Format, argList);
+ va_end(argList);
+}
+
#endif