From 1d643becc5802796826de0135e4d7e10d01fb885 Mon Sep 17 00:00:00 2001 From: Daviw Williams Date: Wed, 27 Mar 2013 15:21:38 +0100 Subject: [PATCH] Replaced std::exit with a crash. --- library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index 70778808..4b4ee263 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -31,9 +31,12 @@ freely, subject to the following restrictions: #include #if defined(_MSC_VER) + // In Visual Studio we can use this function to go into the debugger. #define POLYVOX_HALT() __debugbreak() #else - #define POLYVOX_HALT() std::exit(EXIT_FAILURE) + // On other platforms we just halt by forcing a crash. + // Hopefully this puts us in the debugger if one is running + #define POLYVOX_HALT() *((unsigned int*)0) = 0xDEAD #endif // Macros cannot contain #ifdefs, but some of our macros need to disable warnings and such warning supression is