From 138797e8cb303c72d37dfc4cf42c750cb9d10ca0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnoldo=20Adona=C3=AD=20Bar=C3=B3n=20Robles?= Date: Tue, 18 Feb 2025 19:53:48 -0600 Subject: [PATCH 1/2] Fix msvc build --- munit.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/munit.h b/munit.h index 8460a45..2e557bf 100644 --- a/munit.h +++ b/munit.h @@ -131,7 +131,7 @@ extern "C" { # define MUNIT_UNUSED #endif -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__PGI) +#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 199901L) && !defined(__PGI) && !defined(_MSC_VER) # define MUNIT_ARRAY_PARAM(name) name #else # define MUNIT_ARRAY_PARAM(name) From 6a6714e6b1096327041550cee61725ca4a9da26a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Arnoldo=20Adona=C3=AD=20Bar=C3=B3n=20Robles?= Date: Tue, 18 Feb 2025 19:54:57 -0600 Subject: [PATCH 2/2] Fix clang C99 build --- munit.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/munit.c b/munit.c index 00ede07..f063d85 100644 --- a/munit.c +++ b/munit.c @@ -777,11 +777,13 @@ munit_clock_get_elapsed(struct PsnipClockTimespec* start, struct PsnipClockTimes * important that it be reproducible, so bug reports have a better * chance of being reproducible. */ -#if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201112L) && !defined(__STDC_NO_ATOMICS__) && !defined(__EMSCRIPTEN__) && (!defined(__GNUC_MINOR__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)) -# define HAVE_STDATOMIC -#elif defined(__clang__) -# if __has_extension(c_atomic) -# define HAVE_CLANG_ATOMICS +#if __STDC_VERSION__ >= 201112L +# if defined(__STDC_VERSION__) && !defined(__STDC_NO_ATOMICS__) && !defined(__EMSCRIPTEN__) && (!defined(__GNUC_MINOR__) || (__GNUC__ > 4) || (__GNUC__ == 4 && __GNUC_MINOR__ > 8)) +# define HAVE_STDATOMIC +# elif defined(__clang__) +# if __has_extension(c_atomic) +# define HAVE_CLANG_ATOMICS +# endif # endif #endif