Linux compile fix and updated COMPILING
[xonotic/netradiant.git] / radiant / stacktrace.cpp
index f4daecb1482c17c9214fe65976b9d1815bf2e62e..7c75db423597a7afd6b90dc64cc5169264ae9d86 100644 (file)
@@ -51,7 +51,7 @@ void write_stack_trace(TextOutputStream& outputStream)
 }      
 #endif
 
-#if defined (WIN32) && defined (_MSC_VER)
+#if defined (WIN32) && defined (_MSC_VER) && defined (DEBUG)
 
 #include "windows.h"
 #include "winnt.h"
@@ -308,4 +308,11 @@ void write_stack_trace(TextOutputStream& outputStream)
   __try{ RaiseException(0,0,0,0); } __except(write_stack_trace((GetExceptionInformation())->ContextRecord, outputStream), EXCEPTION_CONTINUE_EXECUTION) {}
 }
 
+#else
+#if defined (WIN32)
+void write_stack_trace(TextOutputStream& outputStream)
+{
+       outputStream << "\nStacktrace is disabled in release-builds\n";
+}
+#endif
 #endif