diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2020-07-27 12:57:45 -0700 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2020-07-27 12:58:12 -0700 |
commit | 0b93877fc4bdcd84b78805e5917e4ab94684b9bc (patch) | |
tree | cdf33f481c7bc22e4344e5994fe66b91ce87db70 | |
parent | 1990797800153088f32029877f503f3157aad9ed (diff) | |
download | gnulib-0b93877fc4bdcd84b78805e5917e4ab94684b9bc.tar.gz |
dfa-tests: port to MSVC
Problem reported by Gisle Vanem in:
https://lists.gnu.org/r/bug-gnulib/2020-07/msg00159.html
Also, remove an unnecessary dependency on getprogname.
* modules/dfa-tests (Depends-on): Remove getprogname.
* tests/test-dfa-match-aux.c: Do not include getprogname.h.
(exit_status): New static var.
(dfawarn): Set it instead of exiting.
Do not declare as _Noreturn, to pacify MSVC.
(main): Return exit_status.
-rw-r--r-- | ChangeLog | 13 | ||||
-rw-r--r-- | modules/dfa-tests | 1 | ||||
-rw-r--r-- | tests/test-dfa-match-aux.c | 10 |
3 files changed, 18 insertions, 6 deletions
@@ -1,3 +1,16 @@ +2020-07-27 Paul Eggert <eggert@cs.ucla.edu> + + dfa-tests: port to MSVC + Problem reported by Gisle Vanem in: + https://lists.gnu.org/r/bug-gnulib/2020-07/msg00159.html + Also, remove an unnecessary dependency on getprogname. + * modules/dfa-tests (Depends-on): Remove getprogname. + * tests/test-dfa-match-aux.c: Do not include getprogname.h. + (exit_status): New static var. + (dfawarn): Set it instead of exiting. + Do not declare as _Noreturn, to pacify MSVC. + (main): Return exit_status. + 2020-07-26 Paul Eggert <eggert@cs.ucla.edu> argz: pacify MSVC diff --git a/modules/dfa-tests b/modules/dfa-tests index 4c447c28e5..2775ccbbf9 100644 --- a/modules/dfa-tests +++ b/modules/dfa-tests @@ -4,7 +4,6 @@ tests/test-dfa-match-aux.c tests/test-dfa-invalid-char-class.sh Depends-on: -getprogname stdio stdlib string diff --git a/tests/test-dfa-match-aux.c b/tests/test-dfa-match-aux.c index e0c5f3df47..21aa613080 100644 --- a/tests/test-dfa-match-aux.c +++ b/tests/test-dfa-match-aux.c @@ -26,8 +26,6 @@ #include <dfa.h> #include <localeinfo.h> -#include "getprogname.h" - _Noreturn void dfaerror (char const *mesg) { @@ -35,11 +33,13 @@ dfaerror (char const *mesg) exit (EXIT_FAILURE); } -_Noreturn void +static int exit_status = EXIT_SUCCESS; + +void dfawarn (char const *mesg) { printf ("dfawarn: %s\n", mesg); - exit (EXIT_FAILURE); + exit_status = EXIT_FAILURE; } int @@ -69,5 +69,5 @@ main (int argc, char **argv) if (p != NULL) printf ("%zd\n", p - beg); - exit (EXIT_SUCCESS); + exit (exit_status); } |