(THIS IS A TRANSITIONAL REVISION, DO NOT USE, WAIT FOR UPDATED DEPS)
[xonotic/netradiant.git] / radiant / stacktrace.cpp
index f4daecb..850556a 100644 (file)
@@ -51,7 +51,7 @@ void write_stack_trace(TextOutputStream& outputStream)
 }      
 #endif
 
 }      
 #endif
 
-#if defined (WIN32) && defined (_MSC_VER)
+#if defined (WIN32) && defined (_MSC_VER) && defined (DEBUG)
 
 #include "windows.h"
 #include "winnt.h"
 
 #include "windows.h"
 #include "winnt.h"
@@ -308,4 +308,9 @@ void write_stack_trace(TextOutputStream& outputStream)
   __try{ RaiseException(0,0,0,0); } __except(write_stack_trace((GetExceptionInformation())->ContextRecord, outputStream), EXCEPTION_CONTINUE_EXECUTION) {}
 }
 
   __try{ RaiseException(0,0,0,0); } __except(write_stack_trace((GetExceptionInformation())->ContextRecord, outputStream), EXCEPTION_CONTINUE_EXECUTION) {}
 }
 
+#else
+void write_stack_trace(TextOutputStream& outputStream)
+{
+       outputStream << "\nStacktrace is disabled in release-builds\n";
+}
 #endif
 #endif