diff options
Diffstat (limited to 'win32')
-rw-r--r-- | win32/PlatWin.cxx | 30 | ||||
-rw-r--r-- | win32/ScintillaWin.cxx | 2 |
2 files changed, 29 insertions, 3 deletions
diff --git a/win32/PlatWin.cxx b/win32/PlatWin.cxx index 2eb2d12f0..654cf3a27 100644 --- a/win32/PlatWin.cxx +++ b/win32/PlatWin.cxx @@ -147,10 +147,10 @@ class FontCached : Font { FontCached *next; int usage; LOGFONT lf; - int hash; + int hash; FontCached(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_); ~FontCached() {} - bool SameAs(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_); + bool SameAs(const char *faceName_, int characterSet_, int size_, bool bold_, bool italic_); virtual void Release(); static FontCached *first; @@ -878,6 +878,32 @@ void Platform::DebugPrintf(const char *, ...) { } #endif +static bool assertionPopUps = true; + +void Platform::ShowAssertionPopUps(bool assertionPopUps_) { + assertionPopUps = assertionPopUps_; +} + +void Platform::Assert(const char *c, const char *file, int line) { + char buffer[2000]; + sprintf(buffer, "Assertion [%s] failed at %s %d", c, file, line); + if (assertionPopUps) { + int idButton = ::MessageBox(0, buffer, "Assertion failure", + MB_ABORTRETRYIGNORE|MB_ICONHAND|MB_SETFOREGROUND|MB_TASKMODAL); + if (idButton == IDRETRY) { + ::DebugBreak(); + } else if (idButton == IDIGNORE) { + // all OK + } else { + abort(); + } + } else { + strcat(buffer, "\r\n"); + Platform::DebugDisplay(buffer); + abort(); + } +} + int Platform::Clamp(int val, int minVal, int maxVal) { if (val > maxVal) val = maxVal; diff --git a/win32/ScintillaWin.cxx b/win32/ScintillaWin.cxx index 1b20d05b9..00e127f98 100644 --- a/win32/ScintillaWin.cxx +++ b/win32/ScintillaWin.cxx @@ -264,7 +264,7 @@ static int InputCodePage() { // Map the key codes to their equivalent SCK_ form static int KeyTranslate(int keyIn) { -//assert(!keyIn); +//PLATFORM_ASSERT(!keyIn); switch (keyIn) { case VK_DOWN: return SCK_DOWN; case VK_UP: return SCK_UP; |