From 8cdc00230d0d9e456b36f95118a95cc58879f28b Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 21 Jun 2013 09:33:48 -0700 Subject: [PATCH] Add BEAST_FILEANDLINE_ macro for warning pragmas --- modules/beast_basics/beast_basics.h | 14 -------------- modules/beast_basics/diagnostic/beast_CatchAny.cpp | 2 +- .../beast_basics/native/beast_posix_FPUFlags.cpp | 2 +- modules/beast_core/system/beast_TargetPlatform.h | 14 ++++++++++++++ 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/modules/beast_basics/beast_basics.h b/modules/beast_basics/beast_basics.h index 32324f4e6..c692151e8 100644 --- a/modules/beast_basics/beast_basics.h +++ b/modules/beast_basics/beast_basics.h @@ -248,14 +248,6 @@ #define BEAST_USE_BZIP2 0 #endif -#ifndef BEAST_USE_FREETYPE -#define BEAST_USE_FREETYPE 0 -#endif - -#ifndef BEAST_USE_NATIVE_FREETYPE -#define BEAST_USE_NATIVE_FREETYPE 1 -#endif - #ifndef BEAST_USE_NATIVE_SQLITE #define BEAST_USE_NATIVE_SQLITE 1 #endif @@ -267,12 +259,6 @@ /* Get this early so we can use it. */ #include "../beast_core/system/beast_TargetPlatform.h" -// Handy macro that lets pragma warnings be clicked in the output window -// Usage: #pragma message(BEAST_LOC_"Advertise here!") -#define BEAST_STR2_(x) #x -#define BEAST_STR1_(x) BEAST_STR2_(x) -#define BEAST_LOC_ __FILE__ "("BEAST_STR1_(__LINE__)") : WARNING: " - #if BEAST_USE_BOOST #include #endif diff --git a/modules/beast_basics/diagnostic/beast_CatchAny.cpp b/modules/beast_basics/diagnostic/beast_CatchAny.cpp index 675e887ac..357755040 100644 --- a/modules/beast_basics/diagnostic/beast_CatchAny.cpp +++ b/modules/beast_basics/diagnostic/beast_CatchAny.cpp @@ -181,7 +181,7 @@ LPTOP_LEVEL_EXCEPTION_FILTER ScopedPlatformExceptionCatcher::s_sehPrev = 0; // TODO: POSIX SIGNAL HANDLER -#pragma message(BEAST_LOC_"Missing class ScopedPlatformExceptionCatcher") +#pragma message(BEAST_FILEANDLINE_ "Missing class ScopedPlatformExceptionCatcher") namespace vf { diff --git a/modules/beast_basics/native/beast_posix_FPUFlags.cpp b/modules/beast_basics/native/beast_posix_FPUFlags.cpp index 09a2f75a3..0b0d476c1 100644 --- a/modules/beast_basics/native/beast_posix_FPUFlags.cpp +++ b/modules/beast_basics/native/beast_posix_FPUFlags.cpp @@ -17,7 +17,7 @@ */ //============================================================================== -//#pragma message(BEAST_LOC_"Missing platform-specific implementation") +//#pragma message(BEAST_FILEANDLINE_ "Missing platform-specific implementation") FPUFlags FPUFlags::getCurrent () { diff --git a/modules/beast_core/system/beast_TargetPlatform.h b/modules/beast_core/system/beast_TargetPlatform.h index 9a11d1e3a..2655cfab3 100644 --- a/modules/beast_core/system/beast_TargetPlatform.h +++ b/modules/beast_core/system/beast_TargetPlatform.h @@ -193,4 +193,18 @@ #error unknown compiler #endif +//------------------------------------------------------------------------------ + +// Handy macro that lets pragma warnings be clicked in the output window +// +// Usage: #pragma message(BEAST_FILEANDLINE_ "Advertise here!") +// +// Note that a space following the macro is mandatory for C++11. +// +// This is here so it can be used in C compilations that include this directly. +// +#define BEAST_PP_STR2_(x) #x +#define BEAST_PP_STR1_(x) BEAST_PP_STR2_(x) +#define BEAST_FILEANDLINE_ __FILE__ "(" BEAST_PP_STR1_(__LINE__) "): warning:" + #endif // BEAST_TARGETPLATFORM_BEASTHEADER