ggformat

A string formatting library for C++
Log | Files | Refs

commit 113ac528d29f35fbc83fb9cce652f75a928e85c8
parent 026224e6199cb38d37f8676e4ed077333c89c65a
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Thu, 24 Aug 2017 18:43:14 +0100

Add GGFORMAT_ to the compiler macros

Diffstat:
ggformat.cc | 2+-
ggformat.h | 12++++++------
2 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/ggformat.cc b/ggformat.cc @@ -61,7 +61,7 @@ static void format_helper( FormatBuffer * fb, const ShortString & fmt, const T & len = 0; } -#if COMPILER_MSVC +#if GGFORMAT_COMPILER_MSVC #pragma warning( disable : 4996 ) // '_snprintf': This function or variable may be unsafe. int printed = _snprintf( NULL, 0, fmt.buf, x ); _snprintf( dst, len, fmt.buf, x ); diff --git a/ggformat.h b/ggformat.h @@ -91,25 +91,25 @@ void format( FormatBuffer * fb, const char * x, const FormatOpts & opts = Format } while( 0 ) #if defined( _MSC_VER ) -# define COMPILER_MSVC 1 +# define GGFORMAT_COMPILER_MSVC 1 #elif defined( __clang__ ) -# define COMPILER_CLANG 1 +# define GGFORMAT_COMPILER_CLANG 1 #elif defined( __GNUC__ ) -# define COMPILER_GCC 1 +# define GGFORMAT_COMPILER_GCC 1 #else # error new compiler #endif // this is optional but helps compile times -#if COMPILER_MSVC +#if GGFORMAT_COMPILER_MSVC # define PRAGMA_DISABLE_OPTIMISATIONS() __pragma( optimize( "", off ) ) # define PRAGMA_ENABLE_OPTIMISATIONS() __pragma( optimize( "", on ) ) -#elif COMPILER_GCC +#elif GGFORMAT_COMPILER_GCC # define PRAGMA_DISABLE_OPTIMISATIONS() \ _Pragma( "GCC push_options" ) \ _Pragma( "GCC optimize (\"O0\")" ) # define PRAGMA_ENABLE_OPTIMISATIONS() _Pragma( "GCC pop_options" ) -#elif COMPILER_CLANG +#elif GGFORMAT_COMPILER_CLANG # define PRAGMA_DISABLE_OPTIMISATIONS() _Pragma( "clang optimize off" ) # define PRAGMA_ENABLE_OPTIMISATIONS() _Pragma( "clang optimize on" ) #else