medfall

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 7d9fb5a0116e5baadbdf3ad667c685ec4fd1defd
parent f88ad8cf1477c03620fa53f5e4bb45b399d847a9
Author: Michael Savage <mikejsavage@gmail.com>
Date:   Sat Mar  4 11:02:23 +0200

Add platform_pragmas.h

Diffstat:
platform_pragmas.h | 15+++++++++++++++
1 file changed, 15 insertions(+), 0 deletions(-)
diff --git a/platform_pragmas.h b/platform_pragmas.h @@ -0,0 +1,15 @@ +#pragma once + +#include "platform.h" + +#if COMPILER_MSVC +#define PRAGMA_DISABLE_OPTIMISATIONS() __pragma( optimize( "", off ) ) +#define PRAGMA_ENABLE_OPTIMISATIONS() __pragma( optimize( "", on ) ) +#elif COMPILER_GCCORCLANG +#define PRAGMA_DISABLE_OPTIMISATIONS() \ + _Pragma( "GCC push_options" ) \ + _Pragma( "GCC optimize (\"O0\")" ) +#define PRAGMA_ENABLE_OPTIMISATIONS() _Pragma( "GCC pop_options" ) +#else +#error new compiler +#endif