From 6e7c0e33b5dd6d86d66ac2eb1a07a33652a708fd Mon Sep 17 00:00:00 2001 From: Tycho Date: Wed, 17 Sep 2014 18:40:10 +0100 Subject: Added first test to show the object can be created --- src/Globals.h | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index de1024010..c75c4e99b 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -261,6 +261,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 -- cgit v1.2.3 From 0d83477540d9eb62c7a4f22f1f5f2b8cd79363ac Mon Sep 17 00:00:00 2001 From: madmaxoft Date: Fri, 26 Sep 2014 22:53:11 +0200 Subject: Fixed UNUSED macro so that it doesn't require type knowledge. Introduced new UNUSED_VAR macro that is used when type knowledge is available (for local variables). --- src/Globals.h | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'src/Globals.h') diff --git a/src/Globals.h b/src/Globals.h index c75c4e99b..0926457da 100644 --- a/src/Globals.h +++ b/src/Globals.h @@ -162,8 +162,17 @@ template class SizeChecker; 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 -- cgit v1.2.3