Skip to content

Commit

Permalink
Add prefix to NOEXCEPT and OVERRIDE macros.
Browse files Browse the repository at this point in the history
Fix for issue #72 : Macro names should have a prefix
  • Loading branch information
nemtrif committed Sep 27, 2020
1 parent 944ef05 commit 3c85cd4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions source/utf8/checked.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,29 +42,29 @@ namespace utf8
uint32_t cp;
public:
invalid_code_point(uint32_t codepoint) : cp(codepoint) {}
virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid code point"; }
virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid code point"; }
uint32_t code_point() const {return cp;}
};

class invalid_utf8 : public exception {
uint8_t u8;
public:
invalid_utf8 (uint8_t u) : u8(u) {}
virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid UTF-8"; }
virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid UTF-8"; }
uint8_t utf8_octet() const {return u8;}
};

class invalid_utf16 : public exception {
uint16_t u16;
public:
invalid_utf16 (uint16_t u) : u16(u) {}
virtual const char* what() const NOEXCEPT OVERRIDE { return "Invalid UTF-16"; }
virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Invalid UTF-16"; }
uint16_t utf16_word() const {return u16;}
};

class not_enough_room : public exception {
public:
virtual const char* what() const NOEXCEPT OVERRIDE { return "Not enough space"; }
virtual const char* what() const UTF_CPP_NOEXCEPT UTF_CPP_OVERRIDE { return "Not enough space"; }
};

/// The library API - functions intended to be called by the users
Expand Down
8 changes: 4 additions & 4 deletions source/utf8/core.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,11 @@ DEALINGS IN THE SOFTWARE.
#endif

#if UTF_CPP_CPLUSPLUS >= 201103L // C++ 11 or later
#define OVERRIDE override
#define NOEXCEPT noexcept
#define UTF_CPP_OVERRIDE override
#define UTF_CPP_NOEXCEPT noexcept
#else // C++ 98/03
#define OVERRIDE
#define NOEXCEPT throw()
#define UTF_CPP_OVERRIDE
#define UTF_CPP_NOEXCEPT throw()
#endif // C++ 11 or later


Expand Down

0 comments on commit 3c85cd4

Please sign in to comment.