|
15 | 15 | # include "Hash/CityHash.h" |
16 | 16 | #endif |
17 | 17 | #ifdef INK_ENABLE_STL |
18 | | -#ifdef INK_ENABLE_EXCEPTIONS |
19 | | -# include <exception> |
20 | | -#endif |
| 18 | +# ifdef INK_ENABLE_EXCEPTIONS |
| 19 | +# include <exception> |
| 20 | +# endif |
21 | 21 | # include <stdexcept> |
22 | 22 | # include <optional> |
23 | 23 | # include <cctype> |
|
32 | 32 | // Platform specific defines // |
33 | 33 |
|
34 | 34 | #ifdef INK_ENABLE_UNREAL |
35 | | -# define inkZeroMemory(buff, len) FMemory::Memset(buff, 0, len) |
36 | | -# define FORMAT_STRING_STR "%hs" |
| 35 | +# define inkZeroMemory(buff, len) FMemory::Memset(buff, 0, len) |
| 36 | +# define FORMAT_STRING_STR "%hs" |
37 | 37 | #else |
38 | 38 | # define inkZeroMemory ink::internal::zero_memory |
39 | 39 | # define FORMAT_STRING_STR "%s" |
|
43 | 43 | # define inkAssert(condition, text, ...) checkf(condition, TEXT(text), ##__VA_ARGS__) |
44 | 44 | # define inkFail(text, ...) checkf(false, TEXT(text), ##__VA_ARGS__) |
45 | 45 | #else |
46 | | -# define inkAssert ink::ink_assert |
47 | | -# define inkFail(...) ink::ink_assert(false, __VA_ARGS__) |
| 46 | +# define inkAssert ink::ink_assert |
| 47 | +# define inkFail(...) ink::ink_assert(false, __VA_ARGS__) |
48 | 48 | #endif |
49 | 49 |
|
50 | 50 | namespace ink |
@@ -215,19 +215,19 @@ void ink_assert(bool condition, const char* msg = nullptr, Args... args) |
215 | 215 | size_t size = snprintf(nullptr, 0, msg, args...) + 1; |
216 | 216 | char* message = static_cast<char*>(malloc(size)); |
217 | 217 | snprintf(message, size, msg, args...); |
218 | | -#ifdef INK_ENABLE_EXCEPTIONS |
| 218 | +# ifdef INK_ENABLE_EXCEPTIONS |
219 | 219 | throw ink_exception(message); |
220 | | -#else |
| 220 | +# else |
221 | 221 | fprintf(stderr, "Ink Assert: %s\n", message); |
222 | 222 | abort(); |
223 | | -#endif |
| 223 | +# endif |
224 | 224 | } else { |
225 | | -#ifdef INK_ENABLE_EXCEPTIONS |
| 225 | +# ifdef INK_ENABLE_EXCEPTIONS |
226 | 226 | throw ink_exception(msg); |
227 | | -#else |
| 227 | +# else |
228 | 228 | fprintf(stderr, "Ink Assert: %s\n", msg); |
229 | 229 | abort(); |
230 | | -#endif |
| 230 | +# endif |
231 | 231 | } |
232 | 232 | } |
233 | 233 | } |
|
0 commit comments