Moved warning suppression into the relevant file so that it's not global.
This commit is contained in:
		| @@ -153,7 +153,7 @@ SET_PROPERTY(TARGET PolyVoxCore PROPERTY FOLDER "Library") | |||||||
|  |  | ||||||
| SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) | SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES VERSION ${POLYVOX_VERSION} SOVERSION ${POLYVOX_VERSION_MAJOR}) | ||||||
| IF(MSVC) | IF(MSVC) | ||||||
| 		SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/W4 /wd4251 /wd4127") #Disable warning on STL exports | 		SET_TARGET_PROPERTIES(PolyVoxCore PROPERTIES COMPILE_FLAGS "/W4 /wd4251") #Disable warning on STL exports | ||||||
| ENDIF(MSVC) | ENDIF(MSVC) | ||||||
|  |  | ||||||
| #Install | #Install | ||||||
|   | |||||||
| @@ -36,6 +36,14 @@ freely, subject to the following restrictions: | |||||||
|     #define POLYVOX_HALT() std::exit(EXIT_FAILURE) |     #define POLYVOX_HALT() std::exit(EXIT_FAILURE) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | // We use the do...while(0) construct in our macros (for reasons see here: http://stackoverflow.com/a/154138) | ||||||
|  | // but Visual Studio gives unhelpful 'conditional expression is constant' warnings. The recommended solution | ||||||
|  | // (http://stackoverflow.com/a/1946485) is to disable these warnings. | ||||||
|  | #if defined(_MSC_VER) | ||||||
|  | 	__pragma(warning(push)) | ||||||
|  | 	__pragma(warning(disable:4127)) | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #define POLYVOX_UNUSED(x) do { (void)sizeof(x); } while(0) | #define POLYVOX_UNUSED(x) do { (void)sizeof(x); } while(0) | ||||||
|  |  | ||||||
| /* | /* | ||||||
| @@ -120,4 +128,9 @@ freely, subject to the following restrictions: | |||||||
| 		getThrowHandler()((except), __FILE__, __LINE__) | 		getThrowHandler()((except), __FILE__, __LINE__) | ||||||
| #endif | #endif | ||||||
|  |  | ||||||
|  | // See the corresponding 'push' above. | ||||||
|  | #if defined(_MSC_VER) | ||||||
|  | 	__pragma(warning(pop)) | ||||||
|  | #endif | ||||||
|  |  | ||||||
| #endif //__PolyVox_ErrorHandling_H__ | #endif //__PolyVox_ErrorHandling_H__ | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user