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 /src | |
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 'src')
-rw-r--r-- | src/Platform.h | 43 |
1 files changed, 19 insertions, 24 deletions
diff --git a/src/Platform.h b/src/Platform.h index 628611132..346e057b1 100644 --- a/src/Platform.h +++ b/src/Platform.h @@ -542,31 +542,26 @@ public: #endif /** - * Platform class used to retrieve system wide parameters such as double click speed - * and chrome colour. Not a creatable object, more of a module with several functions. + * Platform namespace used to retrieve system wide parameters such as double click speed + * and chrome colour. */ -class Platform { -public: - Platform() = default; - Platform(const Platform &) = delete; - Platform(Platform &&) = delete; - Platform &operator=(const Platform &) = delete; - Platform &operator=(Platform &&) = delete; - ~Platform() = default; - static ColourDesired Chrome(); - static ColourDesired ChromeHighlight(); - static const char *DefaultFont(); - static int DefaultFontSize(); - static unsigned int DoubleClickTime(); - static void DebugDisplay(const char *s); - static constexpr long LongFromTwoShorts(short a,short b) noexcept { - return (a) | ((b) << 16); - } - - static void DebugPrintf(const char *format, ...); - static bool ShowAssertionPopUps(bool assertionPopUps_); - static void Assert(const char *c, const char *file, int line) CLANG_ANALYZER_NORETURN; -}; +namespace Platform { + +ColourDesired Chrome(); +ColourDesired ChromeHighlight(); +const char *DefaultFont(); +int DefaultFontSize(); +unsigned int DoubleClickTime(); +constexpr long LongFromTwoShorts(short a,short b) noexcept { + return (a) | ((b) << 16); +} + +void DebugDisplay(const char *s) noexcept; +void DebugPrintf(const char *format, ...) noexcept; +bool ShowAssertionPopUps(bool assertionPopUps_) noexcept; +void Assert(const char *c, const char *file, int line) noexcept CLANG_ANALYZER_NORETURN; + +} #ifdef NDEBUG #define PLATFORM_ASSERT(c) ((void)0) |