From 9273094ebd9e44bf1f5eb1d1187c8978d9962b06 Mon Sep 17 00:00:00 2001 From: David Williams Date: Sat, 29 Dec 2012 22:56:15 +0100 Subject: [PATCH] Added config.h to control exceptions and asserts. --- library/PolyVoxCore/CMakeLists.txt | 1 + .../include/PolyVoxCore/Impl/Config.h | 30 +++++++++++++++++++ .../include/PolyVoxCore/Impl/ErrorHandling.h | 5 ++-- 3 files changed, 33 insertions(+), 3 deletions(-) create mode 100644 library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h diff --git a/library/PolyVoxCore/CMakeLists.txt b/library/PolyVoxCore/CMakeLists.txt index 3fd14b8e..b0304218 100644 --- a/library/PolyVoxCore/CMakeLists.txt +++ b/library/PolyVoxCore/CMakeLists.txt @@ -108,6 +108,7 @@ SET(IMPL_INC_FILES include/PolyVoxCore/Impl/Block.h include/PolyVoxCore/Impl/Block.inl include/PolyVoxCore/Impl/CompilerCapabilities.h + include/PolyVoxCore/Impl/Config.h include/PolyVoxCore/Impl/ErrorHandling.h include/PolyVoxCore/Impl/MarchingCubesTables.h include/PolyVoxCore/Impl/RandomUnitVectors.h diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h new file mode 100644 index 00000000..e97e27af --- /dev/null +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/Config.h @@ -0,0 +1,30 @@ +/******************************************************************************* +Copyright (c) 2005-2009 David Williams + +This software is provided 'as-is', without any express or implied +warranty. In no event will the authors be held liable for any damages +arising from the use of this software. + +Permission is granted to anyone to use this software for any purpose, +including commercial applications, and to alter it and redistribute it +freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + + 3. This notice may not be removed or altered from any source + distribution. +*******************************************************************************/ + +#ifndef __PolyVox_Config_H__ +#define __PolyVox_Config_H__ + +#define POLYVOX_ASSERTS_ENABLED +#define POLYVOX_THROW_ENABLED + +#endif diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index d3ef8b49..8d434c9a 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -24,13 +24,12 @@ freely, subject to the following restrictions: #ifndef __PolyVox_ErrorHandling_H__ #define __PolyVox_ErrorHandling_H__ +#include "PolyVoxCore/Impl/Config.h" + #include //For std::exit #include //For std::cerr #include -#define POLYVOX_ASSERTS_ENABLED -//#define POLYVOX_THROW_ENABLED - #if defined(_MSC_VER) #define POLYVOX_HALT() __debugbreak() #else