From 68ceab0f630085c051d79eb018f8fc9e31d64682 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 --- SConstruct | 2 +- Subtrees/beast/modules/beast_basics/beast_basics.h | 14 -------------- .../beast_basics/diagnostic/beast_CatchAny.cpp | 2 +- .../beast_basics/native/beast_posix_FPUFlags.cpp | 2 +- .../beast_core/system/beast_TargetPlatform.h | 14 ++++++++++++++ modules/ripple_sqlite/ripple_sqlite.c | 5 ----- modules/ripple_sqlite/ripple_sqlite.h | 1 + 7 files changed, 18 insertions(+), 22 deletions(-) diff --git a/SConstruct b/SConstruct index affe0a9c97..695901de73 100644 --- a/SConstruct +++ b/SConstruct @@ -101,7 +101,6 @@ INCLUDE_PATHS = [ ] COMPILED_FILES = [ - 'src/cpp/database/sqlite3.c', 'src/cpp/leveldb_core.cpp', 'Subtrees/beast/modules/beast_core/beast_core.cpp', 'Subtrees/beast/modules/beast_basics/beast_basics.cpp', @@ -109,6 +108,7 @@ COMPILED_FILES = [ 'modules/ripple_data/ripple_data.cpp', 'modules/ripple_json/ripple_json.cpp', 'modules/ripple_websocket/ripple_websocket.cpp', + 'modules/ripple_sqlite/ripple_sqlite.c', 'modules/ripple_app/ripple_app_pt1.cpp', 'modules/ripple_app/ripple_app_pt2.cpp', 'modules/ripple_app/ripple_app_pt3.cpp', diff --git a/Subtrees/beast/modules/beast_basics/beast_basics.h b/Subtrees/beast/modules/beast_basics/beast_basics.h index 32324f4e61..c692151e82 100644 --- a/Subtrees/beast/modules/beast_basics/beast_basics.h +++ b/Subtrees/beast/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/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.cpp b/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.cpp index 675e887ac3..3577550406 100644 --- a/Subtrees/beast/modules/beast_basics/diagnostic/beast_CatchAny.cpp +++ b/Subtrees/beast/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/Subtrees/beast/modules/beast_basics/native/beast_posix_FPUFlags.cpp b/Subtrees/beast/modules/beast_basics/native/beast_posix_FPUFlags.cpp index 09a2f75a30..0b0d476c12 100644 --- a/Subtrees/beast/modules/beast_basics/native/beast_posix_FPUFlags.cpp +++ b/Subtrees/beast/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/Subtrees/beast/modules/beast_core/system/beast_TargetPlatform.h b/Subtrees/beast/modules/beast_core/system/beast_TargetPlatform.h index 9a11d1e3a4..2655cfab35 100644 --- a/Subtrees/beast/modules/beast_core/system/beast_TargetPlatform.h +++ b/Subtrees/beast/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 diff --git a/modules/ripple_sqlite/ripple_sqlite.c b/modules/ripple_sqlite/ripple_sqlite.c index 1a0503018a..f12e055f6e 100644 --- a/modules/ripple_sqlite/ripple_sqlite.c +++ b/modules/ripple_sqlite/ripple_sqlite.c @@ -48,11 +48,6 @@ */ //#define SQLITE_THREADSAFE 2 -// VFALCO TODO Move this into Beast -#define BEAST_PP_STR2_(x) #x -#define BEAST_PP_STR1_(x) BEAST_PP_STR2_(x) -#define BEAST_FILEANDLINE_ __FILE__ "("BEAST_PP_STR1_(__LINE__)"): warning:" - // VFALCO TODO We should try running with SQLITE_THREADSAFE==2 and see what happens. #if SQLITE_THREADSAFE != 2 #pragma message(BEAST_FILEANDLINE_"Possible performance issue, SQLITE_THREADSAFE != 2") diff --git a/modules/ripple_sqlite/ripple_sqlite.h b/modules/ripple_sqlite/ripple_sqlite.h index c5ddd97e48..b750af4e7f 100644 --- a/modules/ripple_sqlite/ripple_sqlite.h +++ b/modules/ripple_sqlite/ripple_sqlite.h @@ -20,6 +20,7 @@ #ifndef RIPPLE_SQLITE_RIPPLEHEADER #define RIPPLE_SQLITE_RIPPLEHEADER +// Include this directly because we compile under both C and C++ #include "beast/modules/beast_core/system/beast_TargetPlatform.h" #if ! RIPPLE_SQLITE_MODULE_INCLUDED