diff options
Diffstat (limited to 'cassert')
-rw-r--r-- | cassert/CMakeLists.txt | 4 | ||||
-rw-r--r-- | cassert/include/cassert.h | 17 |
2 files changed, 9 insertions, 12 deletions
diff --git a/cassert/CMakeLists.txt b/cassert/CMakeLists.txt index 13e5560..fedb082 100644 --- a/cassert/CMakeLists.txt +++ b/cassert/CMakeLists.txt | |||
@@ -2,6 +2,10 @@ cmake_minimum_required(VERSION 3.5) | |||
2 | 2 | ||
3 | project(cassert) | 3 | project(cassert) |
4 | 4 | ||
5 | set(CMAKE_C_STANDARD 23) | ||
6 | set(CMAKE_C_STANDARD_REQUIRED On) | ||
7 | set(CMAKE_C_EXTENSIONS Off) | ||
8 | |||
5 | add_library(cassert INTERFACE) | 9 | add_library(cassert INTERFACE) |
6 | 10 | ||
7 | target_include_directories(cassert INTERFACE | 11 | target_include_directories(cassert INTERFACE |
diff --git a/cassert/include/cassert.h b/cassert/include/cassert.h index bb98f50..590f684 100644 --- a/cassert/include/cassert.h +++ b/cassert/include/cassert.h | |||
@@ -6,18 +6,11 @@ | |||
6 | // Allow the client to define their own LOGE() macro. | 6 | // Allow the client to define their own LOGE() macro. |
7 | #ifndef LOGE | 7 | #ifndef LOGE |
8 | #include <stdio.h> | 8 | #include <stdio.h> |
9 | // __VA_OPT__ is not available until C2X. | 9 | #define LOGE(...) \ |
10 | /*#define LOGE(format, ...) \ | 10 | { \ |
11 | { \ | 11 | fprintf(stderr, "[ASSERT] %s:%d", __FILE__, __LINE__); \ |
12 | fprintf( \ | 12 | fprintf(stderr, " " __VA_ARGS__); \ |
13 | stderr, "[ASSERT] %s:%d " format "\n", __FILE__, \ | 13 | fprintf(stderr, "\n"); \ |
14 | __LINE__ __VA_OPT__(, ) __VA_ARGS__); \ | ||
15 | }*/ | ||
16 | #define LOGE(...) \ | ||
17 | { \ | ||
18 | fprintf(stderr, "[ASSERT] %s:%d ", __FILE__, __LINE__); \ | ||
19 | fprintf(stderr, __VA_ARGS__); \ | ||
20 | fprintf(stderr, "\n"); \ | ||
21 | } | 14 | } |
22 | #endif // LOGE | 15 | #endif // LOGE |
23 | 16 | ||