platform_pragmas.h (585B)
1 #pragma once 2 3 #include "platform.h" 4 5 #if COMPILER_MSVC 6 #define PRAGMA_DISABLE_OPTIMISATIONS() __pragma( optimize( "", off ) ) 7 #define PRAGMA_ENABLE_OPTIMISATIONS() __pragma( optimize( "", on ) ) 8 #elif COMPILER_GCC 9 #define PRAGMA_DISABLE_OPTIMISATIONS() \ 10 _Pragma( "GCC push_options" ) \ 11 _Pragma( "GCC optimize (\"O0\")" ) 12 #define PRAGMA_ENABLE_OPTIMISATIONS() _Pragma( "GCC pop_options" ) 13 #elif COMPILER_CLANG 14 #define PRAGMA_DISABLE_OPTIMISATIONS() _Pragma( "clang optimize off" ) 15 #define PRAGMA_ENABLE_OPTIMISATIONS() _Pragma( "clang optimize on" ) 16 #else 17 #error new compiler 18 #endif