Moved more code into PlatformDefinitions.h

This commit is contained in:
David Williams 2015-05-08 15:20:29 +02:00
parent 64fa004102
commit e9bde59fbc
2 changed files with 13 additions and 13 deletions

View File

@ -35,19 +35,6 @@ freely, subject to the following restrictions:
#include <string.h> // Exception constuctors take strings. #include <string.h> // Exception constuctors take strings.
#include <csignal> #include <csignal>
// Macros cannot contain #ifdefs, but some of our macros need to disable warnings and such warning supression is
// platform specific. But macros can contain other macros, so we create macros to control the warnings and use
// those instead. This set of warning supression macros can be extended to GCC/Clang when required.
#if defined(_MSC_VER)
#define POLYVOX_MSC_WARNING_PUSH __pragma(warning(push))
#define POLYVOX_DISABLE_MSC_WARNING(x) __pragma(warning(disable:x))
#define POLYVOX_MSC_WARNING_POP __pragma(warning(pop))
#else
#define POLYVOX_MSC_WARNING_PUSH
#define POLYVOX_DISABLE_MSC_WARNING(x)
#define POLYVOX_MSC_WARNING_POP
#endif
/* /*
* Assertions * Assertions
* ---------- * ----------

View File

@ -32,6 +32,19 @@ freely, subject to the following restrictions:
#error "Your version of Visual Studio is too old to build PolyVox. You need at least version Visual Stusio 2013" #error "Your version of Visual Studio is too old to build PolyVox. You need at least version Visual Stusio 2013"
#endif #endif
// Macros cannot contain #ifdefs, but some of our macros need to disable warnings and such warning supression is
// platform specific. But macros can contain other macros, so we create macros to control the warnings and use
// those instead. This set of warning supression macros can be extended to GCC/Clang when required.
#if defined(_MSC_VER)
#define POLYVOX_MSC_WARNING_PUSH __pragma(warning(push))
#define POLYVOX_DISABLE_MSC_WARNING(x) __pragma(warning(disable:x))
#define POLYVOX_MSC_WARNING_POP __pragma(warning(pop))
#else
#define POLYVOX_MSC_WARNING_PUSH
#define POLYVOX_DISABLE_MSC_WARNING(x)
#define POLYVOX_MSC_WARNING_POP
#endif
// Used to mark functions as deprecated prior to us removing them. // Used to mark functions as deprecated prior to us removing them.
#if defined _WIN32 || defined __CYGWIN__ #if defined _WIN32 || defined __CYGWIN__
#define POLYVOX_DEPRECATED __declspec(deprecated) #define POLYVOX_DEPRECATED __declspec(deprecated)