aboutsummaryrefslogtreecommitdiff
path: root/src/server/shared/Debugging
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/shared/Debugging')
-rw-r--r--src/server/shared/Debugging/Errors.cpp11
-rw-r--r--src/server/shared/Debugging/Errors.h16
-rw-r--r--src/server/shared/Debugging/WheatyExceptionReport.cpp2
3 files changed, 18 insertions, 11 deletions
diff --git a/src/server/shared/Debugging/Errors.cpp b/src/server/shared/Debugging/Errors.cpp
index d656dc3fb4a..62e97d56d42 100644
--- a/src/server/shared/Debugging/Errors.cpp
+++ b/src/server/shared/Debugging/Errors.cpp
@@ -18,17 +18,15 @@
#include "Errors.h"
-#include <ace/Stack_Trace.h>
-#include <ace/OS_NS_unistd.h>
#include <cstdlib>
+#include <thread>
namespace Trinity {
void Assert(char const* file, int line, char const* function, char const* message)
{
- ACE_Stack_Trace st;
- fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n%s\n",
- file, line, function, message, st.c_str());
+ fprintf(stderr, "\n%s:%i in %s ASSERTION FAILED:\n %s\n",
+ file, line, function, message);
*((volatile int*)NULL) = 0;
exit(1);
}
@@ -37,7 +35,8 @@ void Fatal(char const* file, int line, char const* function, char const* message
{
fprintf(stderr, "\n%s:%i in %s FATAL ERROR:\n %s\n",
file, line, function, message);
- ACE_OS::sleep(10);
+
+ std::this_thread::sleep_for(std::chrono::seconds(10));
*((volatile int*)NULL) = 0;
exit(1);
}
diff --git a/src/server/shared/Debugging/Errors.h b/src/server/shared/Debugging/Errors.h
index 7d521fefca0..218acfa453e 100644
--- a/src/server/shared/Debugging/Errors.h
+++ b/src/server/shared/Debugging/Errors.h
@@ -34,10 +34,18 @@ namespace Trinity
} // namespace Trinity
-#define WPAssert(cond) do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while (0)
-#define WPFatal(cond, msg) do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
-#define WPError(cond, msg) do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
-#define WPWarning(cond, msg) do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while (0)
+#if COMPILER == COMPILER_MICROSOFT
+#define ASSERT_BEGIN __pragma(warning(push)) __pragma(warning(disable: 4127))
+#define ASSERT_END __pragma(warning(pop))
+#else
+#define ASSERT_BEGIN
+#define ASSERT_END
+#endif
+
+#define WPAssert(cond) ASSERT_BEGIN do { if (!(cond)) Trinity::Assert(__FILE__, __LINE__, __FUNCTION__, #cond); } while(0) ASSERT_END
+#define WPFatal(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Fatal(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
+#define WPError(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Error(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
+#define WPWarning(cond, msg) ASSERT_BEGIN do { if (!(cond)) Trinity::Warning(__FILE__, __LINE__, __FUNCTION__, (msg)); } while(0) ASSERT_END
#define ASSERT WPAssert
diff --git a/src/server/shared/Debugging/WheatyExceptionReport.cpp b/src/server/shared/Debugging/WheatyExceptionReport.cpp
index 350a258f455..2eb456ddd02 100644
--- a/src/server/shared/Debugging/WheatyExceptionReport.cpp
+++ b/src/server/shared/Debugging/WheatyExceptionReport.cpp
@@ -677,7 +677,7 @@ bool bWriteVariables, HANDLE pThreadHandle)
dwMachineType = IMAGE_FILE_MACHINE_AMD64;
#endif
- while (1)
+ for (;;)
{
// Get the next stack frame
if (! StackWalk64(dwMachineType,