diff options
author | sanine-a <sanine.not@pm.me> | 2022-12-15 14:07:24 -0600 |
---|---|---|
committer | sanine-a <sanine.not@pm.me> | 2022-12-15 14:07:24 -0600 |
commit | d301084c27812519de466fc905af3e85d928b737 (patch) | |
tree | 063ea303baa089279c4e0ace7bf12cad7c050fe3 | |
parent | 9bc220eb2ba77e6a7184d7b63f086e6a268b75e3 (diff) |
fix compile errors for msvc
-rw-r--r-- | CMakeLists.txt | 2 | ||||
-rw-r--r-- | lily-test.h | 6 | ||||
-rw-r--r-- | tests/macro-tests.c | 5 |
3 files changed, 6 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 3949e14..15f0ce8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,4 +16,4 @@ add_executable(lily-metatest ) set_target_properties(lily-metatest PROPERTIES C_STANDARD 90 - CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic") + CMAKE_C_FLAGS "-Wall -Wextra -Werror -Wfatal-errors -Wpedantic -pedantic-errors") diff --git a/lily-test.h b/lily-test.h index 6d2d0a4..8f8b61c 100644 --- a/lily-test.h +++ b/lily-test.h @@ -84,11 +84,10 @@ /* automatic registration macros */ typedef struct lily_ll_node_t { struct lily_ll_node_t *next; - const char *description; void (*f)(); } lily_ll_node_t; -#define LILY_FILE_BEGIN() \ -static lily_ll_node_t lily_ll_last = { NULL, NULL, NULL }; +#define LILY_FILE_BEGIN(unique_id) \ +static lily_ll_node_t lily_ll_last = { NULL, NULL }; #define LILY_LIST_HEAD lily_ll_last #define LILY_LIST_NEXT lily_ll_last #define LILY_PUSH_TEST() LILY_TEST_H_LOCATION @@ -437,7 +436,6 @@ static lily_ll_node_t LILY_ANON_NODE = { &LILY_LIST_HEAD, #define LILY_COUNTER_INCREMENT #include LILY_TEST_H_LOCATION - LILY_ANON_DESC, LILY_ANON_FUNC, }; #undef LILY_LIST_HEAD diff --git a/tests/macro-tests.c b/tests/macro-tests.c index 81a2932..d08b567 100644 --- a/tests/macro-tests.c +++ b/tests/macro-tests.c @@ -1,3 +1,4 @@ +#include <string.h> #include "lily-test.h" #include "tests.h" @@ -5,7 +6,7 @@ const char * test_LILY_LOCATION() { /* do NOT move the following line, or this test will break! */ - if (strcmp(LILY_LOCATION, "tests/macro-tests.c:8") != 0) { + if (strcmp(LILY_LOCATION, "tests/macro-tests.c:8") != 0 && strcmp(LILY_LOCATION, "tests\\macro-tests.c:8") != 0) { return "LILY_LOCATION refers to the wrong location!"; } return 0; @@ -303,7 +304,7 @@ const char * test_LILY_COUNTER_DECREMENT() } -LILY_FILE_BEGIN() +LILY_FILE_BEGIN(unique_identifier) int array[3] = { 0, 0, 0 }; |