From 906d685f5f93dc0bc70064dc9c17c7c154a1f8e8 Mon Sep 17 00:00:00 2001 From: David Williams Date: Thu, 30 Jan 2014 23:04:37 +0100 Subject: [PATCH] Stripped down the 'removed' version of the logging macros to minimize the chance that they have any effect on the code. --- .../include/PolyVoxCore/Impl/Logging.h | 114 +++--------------- 1 file changed, 18 insertions(+), 96 deletions(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h index ea138e15..ab6bcade 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Logging.h @@ -111,23 +111,10 @@ namespace PolyVox #else - #define POLYVOX_LOG_TRACE(message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP - + // We don't bother with the do...while(0) construct here as we're not executing multiple statements + #define POLYVOX_LOG_TRACE(message) #define POLYVOX_LOG_TRACE_IF(condition, message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(condition); POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP + POLYVOX_UNUSED(condition) #endif @@ -166,23 +153,10 @@ namespace PolyVox #else - #define POLYVOX_LOG_DEBUG(message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP - + // We don't bother with the do...while(0) construct here as we're not executing multiple statements + #define POLYVOX_LOG_DEBUG(message) #define POLYVOX_LOG_DEBUG_IF(condition, message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(condition); POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP + POLYVOX_UNUSED(condition) #endif @@ -221,23 +195,10 @@ namespace PolyVox #else - #define POLYVOX_LOG_INFO(message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP - + // We don't bother with the do...while(0) construct here as we're not executing multiple statements + #define POLYVOX_LOG_INFO(message) #define POLYVOX_LOG_INFO_IF(condition, message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(condition); POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP + POLYVOX_UNUSED(condition) #endif @@ -276,23 +237,10 @@ namespace PolyVox #else - #define POLYVOX_LOG_WARNING(message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP - + // We don't bother with the do...while(0) construct here as we're not executing multiple statements + #define POLYVOX_LOG_WARNING(message) #define POLYVOX_LOG_WARNING_IF(condition, message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(condition); POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP + POLYVOX_UNUSED(condition) #endif @@ -331,23 +279,10 @@ namespace PolyVox #else - #define POLYVOX_LOG_ERROR(message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP - + // We don't bother with the do...while(0) construct here as we're not executing multiple statements + #define POLYVOX_LOG_ERROR(message) #define POLYVOX_LOG_ERROR_IF(condition, message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(condition); POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP + POLYVOX_UNUSED(condition) #endif @@ -386,23 +321,10 @@ namespace PolyVox #else - #define POLYVOX_LOG_FATAL(message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP - + // We don't bother with the do...while(0) construct here as we're not executing multiple statements + #define POLYVOX_LOG_FATAL(message) #define POLYVOX_LOG_FATAL_IF(condition, message) \ - /* We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) \ - but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution \ - (http://stackoverflow.com/a/1946485) is to disable these warnings. */ \ - POLYVOX_MSC_WARNING_PUSH \ - POLYVOX_DISABLE_MSC_WARNING(4127) \ - do { POLYVOX_UNUSED(condition); POLYVOX_UNUSED(message); } while(0) \ - POLYVOX_MSC_WARNING_POP + POLYVOX_UNUSED(condition) #endif