diff options
Diffstat (limited to 'dep/g3dlite/source/debugAssert.cpp')
-rw-r--r-- | dep/g3dlite/source/debugAssert.cpp | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/dep/g3dlite/source/debugAssert.cpp b/dep/g3dlite/source/debugAssert.cpp index 41aad02c640..92ce2376490 100644 --- a/dep/g3dlite/source/debugAssert.cpp +++ b/dep/g3dlite/source/debugAssert.cpp @@ -11,7 +11,7 @@ #include "G3D/debugAssert.h" #include "G3D/platform.h" -#ifdef G3D_WIN32 +#ifdef G3D_WINDOWS #include <tchar.h> #endif #include "G3D/format.h" @@ -44,7 +44,7 @@ AssertionHook _failureHook = _handleErrorCheck_; #endif -#ifdef G3D_WIN32 +#ifdef G3D_WINDOWS static void postToClipboard(const char *text) { if (OpenClipboard(NULL)) { HGLOBAL hMem = GlobalAlloc(GHND | GMEM_DDESHARE, strlen(text) + 1); @@ -77,7 +77,7 @@ static void createErrorMessage( std::string le = ""; const char* newline = "\n"; - #ifdef G3D_WIN32 + #ifdef G3D_WINDOWS newline = "\r\n"; // The last error value. (Which is preserved across the call). @@ -106,9 +106,9 @@ static void createErrorMessage( realLastErr = _T("Last error code does not exist."); } - if (lastErr != 0) { - le = G3D::format("Last Error (0x%08X): %s\r\n\r\n", lastErr, (LPCSTR)realLastErr); - } + if (lastErr != 0) { + le = G3D::format("Last Error (0x%08X): %s\r\n\r\n", lastErr, (LPCSTR)realLastErr); + } // Get rid of the allocated memory from FormatMessage. if (NULL != formatMsg) { @@ -142,7 +142,7 @@ bool _handleDebugAssert_( std::string dialogText = ""; createErrorMessage(expression, message, filename, lineNumber, dialogTitle, dialogText); - #ifdef G3D_WIN32 + #ifdef G3D_WINDOWS DWORD lastErr = GetLastError(); postToClipboard(dialogText.c_str()); debugPrintf("\n%s\n", dialogText.c_str()); @@ -159,7 +159,7 @@ bool _handleDebugAssert_( int result = G3D::prompt(dialogTitle.c_str(), dialogText.c_str(), (const char**)choices, 3, useGuiPrompt); -# ifdef G3D_WIN32 +# ifdef G3D_WINDOWS // Put the incoming last error back. SetLastError(lastErr); # endif @@ -200,7 +200,7 @@ bool _handleErrorCheck_( // Log the error Log::common()->print(std::string("\n**************************\n\n") + dialogTitle + "\n" + dialogText); - #ifdef G3D_WIN32 + #ifdef G3D_WINDOWS DWORD lastErr = GetLastError(); (void)lastErr; postToClipboard(dialogText.c_str()); @@ -212,7 +212,7 @@ bool _handleErrorCheck_( const std::string& m = std::string("An internal error has occured in this program and it will now close. " "The specific error is below. More information has been saved in \"") + - Log::getCommonLogFilename() + "\".\n" + dialogText; + Log::getCommonLogFilename() + "\".\n\n" + dialogText; int result = G3D::prompt("Error", m.c_str(), (const char**)choices, 1, useGuiPrompt); (void)result; @@ -221,7 +221,7 @@ bool _handleErrorCheck_( } -#ifdef G3D_WIN32 +#ifdef G3D_WINDOWS static HCURSOR oldCursor; static RECT oldCursorRect; static POINT oldCursorPos; @@ -229,7 +229,7 @@ static int oldShowCursorCount; #endif void _releaseInputGrab_() { - #ifdef G3D_WIN32 + #ifdef G3D_WINDOWS GetCursorPos(&oldCursorPos); @@ -275,7 +275,7 @@ void _releaseInputGrab_() { void _restoreInputGrab_() { - #ifdef G3D_WIN32 + #ifdef G3D_WINDOWS // Restore the old clipping region ClipCursor(&oldCursorRect); @@ -307,7 +307,7 @@ void setAssertionHook(AssertionHook hook) { } AssertionHook assertionHook() { - return G3D::_internal::_debugHook; + return G3D::_internal::_debugHook; } void setFailureHook(AssertionHook hook) { @@ -329,7 +329,7 @@ ConsolePrintHook consolePrintHook() { std::string __cdecl debugPrint(const std::string& s) { -# ifdef G3D_WIN32 +# ifdef G3D_WINDOWS const int MAX_STRING_LEN = 1024; // Windows can't handle really long strings sent to |