From: Paul Eggert Date: Mon, 19 May 2025 06:16:15 +0000 (-0700) Subject: tests: simplify test_exit_status decl X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6907c115c19d8dc535902b721cc05d7e4aab34d1;p=thirdparty%2Fgnulib.git tests: simplify test_exit_status decl * tests/macros.h (test_exit_status) [!NO_MAIN_HERE]: Declare test_exit_status too, as this is simpler and we might as well check definition vs declaration. --- diff --git a/ChangeLog b/ChangeLog index 09c5b008df..75792d4fe2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2025-05-18 Paul Eggert + + tests: simplify test_exit_status decl + * tests/macros.h (test_exit_status) [!NO_MAIN_HERE]: + Declare test_exit_status too, as this is simpler + and we might as well check definition vs declaration. + 2025-05-18 Bruno Haible unigbrk/u*-grapheme-prev: Support Indic, Emojis, regional indicators. diff --git a/tests/macros.h b/tests/macros.h index a6ac1c9f3b..e65d8ebdc9 100644 --- a/tests/macros.h +++ b/tests/macros.h @@ -56,9 +56,8 @@ Set to EXIT_FAILURE when an ASSERT or ASSERT_NO_STDIO fails. */ /* To satisfy the "one definition rule", we define the variable in the compilation unit that contains the main() function. */ -#ifdef NO_MAIN_HERE extern int volatile test_exit_status; -#else +#ifndef NO_MAIN_HERE int volatile test_exit_status = EXIT_SUCCESS; #endif