From 8027f9904de5263813cce2b6ad4e64d9c1cfd809 Mon Sep 17 00:00:00 2001 From: Matt Williams Date: Thu, 4 Jul 2013 19:34:49 +0100 Subject: [PATCH] On systems that support it, raise SIGTRAP to drop into the debugger Clang was being clever and giving a warning for this line so it prompted me to fix it. I believe that SIGTRAP is the correct way to get the debugger to work here. It does a compile-time check for the platform when not using MSVC. Discussed at http://www.volumesoffun.com/phpBB3/viewtopic.php?p=3766#p3766 --- .../PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h index afc452c0..5c6f6b0f 100644 --- a/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h +++ b/library/PolyVoxCore/include/PolyVoxCore/Impl/ErrorHandling.h @@ -31,6 +31,7 @@ freely, subject to the following restrictions: #include #include #include // Exception constuctors take strings. +#include #if defined(_MSC_VER) // In Visual Studio we can use this function to go into the debugger. @@ -38,7 +39,11 @@ freely, subject to the following restrictions: #else // 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 + #if defined(__linux__) || defined(__APPLE__) + #define POLYVOX_HALT() raise(SIGTRAP) + #else + #define POLYVOX_HALT() *((unsigned int*)0) = 0xDEAD + #endif #endif // Macros cannot contain #ifdefs, but some of our macros need to disable warnings and such warning supression is