]> Savannah Git Hosting - gnulib.git/commitdiff
dfa-tests: port to MSVC
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Jul 2020 19:57:45 +0000 (12:57 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 27 Jul 2020 19:58:12 +0000 (12:58 -0700)
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.

ChangeLog
modules/dfa-tests
tests/test-dfa-match-aux.c

index 63138b822a5440d89c14ffbe452bb4df002e8175..d3297232fd5873b4a2e3ac4943dc3fc8003d79e0 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -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
index 4c447c28e506e2d89a71f50c004c2da097b936c2..2775ccbbf98126b30336c303776ca9604f97acf3 100644 (file)
@@ -4,7 +4,6 @@ tests/test-dfa-match-aux.c
 tests/test-dfa-invalid-char-class.sh
 
 Depends-on:
-getprogname
 stdio
 stdlib
 string
index e0c5f3df47e807433869e912c39eb8f11c5d06b5..21aa613080c7fe15c54afb3da72a190bd8d204f0 100644 (file)
@@ -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);
 }