From 6709240b7a36d7aab7a83d4ddd2765e45e687c5d Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Sun, 5 May 2019 18:07:26 +0300 Subject: Fix compilation of mod-test.c on MinGW * test/data/emacs-module/mod-test.c (Fmod_test_nanoseconds) [__MINGW32__]: Use _Static_assert, not static_assert, as the latter is not available in mingw.org's MinGW's assert.h. --- test/data/emacs-module/mod-test.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'test/data/emacs-module') diff --git a/test/data/emacs-module/mod-test.c b/test/data/emacs-module/mod-test.c index fccc60fe4dd..ad962d5f685 100644 --- a/test/data/emacs-module/mod-test.c +++ b/test/data/emacs-module/mod-test.c @@ -377,7 +377,11 @@ Fmod_test_nanoseconds (emacs_env *env, ptrdiff_t nargs, emacs_value *args, void struct emacs_mpz nanoseconds; assert (LONG_MIN <= time.tv_sec && time.tv_sec <= LONG_MAX); mpz_init_set_si (nanoseconds.value, time.tv_sec); +#ifdef __MINGW32__ + _Static_assert (1000000000 <= ULONG_MAX, "unsupported architecture"); +#else static_assert (1000000000 <= ULONG_MAX, "unsupported architecture"); +#endif mpz_mul_ui (nanoseconds.value, nanoseconds.value, 1000000000); assert (0 <= time.tv_nsec && time.tv_nsec <= ULONG_MAX); mpz_add_ui (nanoseconds.value, nanoseconds.value, time.tv_nsec); -- cgit v1.2.1