diff options
author | Neil <nyamatongwe@gmail.com> | 2021-03-16 23:48:30 +1100 |
---|---|---|
committer | Neil <nyamatongwe@gmail.com> | 2021-03-16 23:48:30 +1100 |
commit | 99d16b51f142281f7d81cf3f704aff0e97bd1feb (patch) | |
tree | 4c650b9eb3c9299ab303fc918a1c263b3fa4637f /cocoa | |
parent | 4ac2ffc2fe88b80ad44fe495ff71912bceb4375a (diff) | |
download | scintilla-mirror-99d16b51f142281f7d81cf3f704aff0e97bd1feb.tar.gz |
Convert Platform from a class to a namespace. Does not change callers.
Make Assert, DebugPrintf, and similar noexcept so they can be used in noexcept
methods and they don't throw.
Diffstat (limited to 'cocoa')
-rw-r--r-- | cocoa/PlatCocoa.mm | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/cocoa/PlatCocoa.mm b/cocoa/PlatCocoa.mm index 5eb5bf018..3939147c2 100644 --- a/cocoa/PlatCocoa.mm +++ b/cocoa/PlatCocoa.mm @@ -2089,13 +2089,13 @@ unsigned int Platform::DoubleClickTime() { //#define TRACE #ifdef TRACE -void Platform::DebugDisplay(const char *s) { +void Platform::DebugDisplay(const char *s) noexcept { fprintf(stderr, "%s", s); } //-------------------------------------------------------------------------------------------------- -void Platform::DebugPrintf(const char *format, ...) { +void Platform::DebugPrintf(const char *format, ...) noexcept { const int BUF_SIZE = 2000; char buffer[BUF_SIZE]; @@ -2108,9 +2108,9 @@ void Platform::DebugPrintf(const char *format, ...) { #else -void Platform::DebugDisplay(const char *) {} +void Platform::DebugDisplay(const char *) noexcept {} -void Platform::DebugPrintf(const char *, ...) {} +void Platform::DebugPrintf(const char *, ...) noexcept {} #endif @@ -2118,7 +2118,7 @@ void Platform::DebugPrintf(const char *, ...) {} static bool assertionPopUps = true; -bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { +bool Platform::ShowAssertionPopUps(bool assertionPopUps_) noexcept { bool ret = assertionPopUps; assertionPopUps = assertionPopUps_; return ret; @@ -2126,7 +2126,7 @@ bool Platform::ShowAssertionPopUps(bool assertionPopUps_) { //-------------------------------------------------------------------------------------------------- -void Platform::Assert(const char *c, const char *file, int line) { +void Platform::Assert(const char *c, const char *file, int line) noexcept { char buffer[2000]; snprintf(buffer, sizeof(buffer), "Assertion [%s] failed at %s %d\r\n", c, file, line); Platform::DebugDisplay(buffer); |