0
0
mirror of https://github.com/nemtrif/utfcpp.git synced 2026-01-18 17:11:21 +01:00

Fix the name clash with assert macro

This commit is contained in:
nemtrif
2025-09-15 17:19:34 -04:00
parent cfea16a734
commit acd249b2a2
2 changed files with 5 additions and 3 deletions

View File

@@ -48,9 +48,9 @@ DEALINGS IN THE SOFTWARE.
#define UTF_CPP_OVERRIDE
#define UTF_CPP_NOEXCEPT throw()
// Simulate static_assert:
template <bool Condition> struct StaticAssert {static void assert() {int static_assert_impl[(Condition ? 1 : -1)];} };
template <> struct StaticAssert<true> {static void assert() {}};
#define UTF_CPP_STATIC_ASSERT(condition) StaticAssert<condition>::assert();
template <bool Condition> struct StaticAssert {static void utf8_static_assert() {int static_assert_impl[(Condition ? 1 : -1)];} };
template <> struct StaticAssert<true> {static void utf8_static_assert() {}};
#define UTF_CPP_STATIC_ASSERT(condition) StaticAssert<condition>::utf8_static_assert();
#endif // C++ 11 or later

View File

@@ -1,5 +1,7 @@
#include "ftest.h"
#include <cassert>
#include "test_checked_api.h"
#include "test_checked_iterator.h"
#include "test_unchecked_api.h"