Added config.h to control exceptions and asserts.

This commit is contained in:
David Williams 2012-12-29 22:56:15 +01:00
parent 161835f42b
commit 9273094ebd
3 changed files with 33 additions and 3 deletions

View File

@ -108,6 +108,7 @@ SET(IMPL_INC_FILES
include/PolyVoxCore/Impl/Block.h include/PolyVoxCore/Impl/Block.h
include/PolyVoxCore/Impl/Block.inl include/PolyVoxCore/Impl/Block.inl
include/PolyVoxCore/Impl/CompilerCapabilities.h include/PolyVoxCore/Impl/CompilerCapabilities.h
include/PolyVoxCore/Impl/Config.h
include/PolyVoxCore/Impl/ErrorHandling.h include/PolyVoxCore/Impl/ErrorHandling.h
include/PolyVoxCore/Impl/MarchingCubesTables.h include/PolyVoxCore/Impl/MarchingCubesTables.h
include/PolyVoxCore/Impl/RandomUnitVectors.h include/PolyVoxCore/Impl/RandomUnitVectors.h

View File

@ -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

View File

@ -24,13 +24,12 @@ freely, subject to the following restrictions:
#ifndef __PolyVox_ErrorHandling_H__ #ifndef __PolyVox_ErrorHandling_H__
#define __PolyVox_ErrorHandling_H__ #define __PolyVox_ErrorHandling_H__
#include "PolyVoxCore/Impl/Config.h"
#include <cstdlib> //For std::exit #include <cstdlib> //For std::exit
#include <iostream> //For std::cerr #include <iostream> //For std::cerr
#include <stdexcept> #include <stdexcept>
#define POLYVOX_ASSERTS_ENABLED
//#define POLYVOX_THROW_ENABLED
#if defined(_MSC_VER) #if defined(_MSC_VER)
#define POLYVOX_HALT() __debugbreak() #define POLYVOX_HALT() __debugbreak()
#else #else