]> Savannah Git Hosting - gnulib.git/commitdiff
getopt-posix, getopt-gnu tests: Avoid test failure on mingw.
authorBruno Haible <bruno@clisp.org>
Wed, 24 Jul 2024 00:02:45 +0000 (02:02 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 15:57:36 +0000 (17:57 +0200)
* tests/test-getopt.h (test_getopt): Don't special-case mingw.

ChangeLog
tests/test-getopt.h

index 085ff3f9520808c020d9949aa8e9840efbd4ab6b..9b50f55cda7e3e9ba0b3413c8e47fc6ea8172ee4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2024-07-23  Bruno Haible  <bruno@clisp.org>
+
+       getopt-posix, getopt-gnu tests: Avoid test failure on mingw.
+       * tests/test-getopt.h (test_getopt): Don't special-case mingw.
+
 2024-07-23  Bruno Haible  <bruno@clisp.org>
 
        strtod: Revisit underflow behaviour.
index f13b59596b9c0377ac9baef0213fd7d4ca7c6f2f..43d23ca1fad0aa9b69393566423b2eaca15b797c 100644 (file)
@@ -85,8 +85,10 @@ test_getopt (void)
   bool posixly = !!getenv ("POSIXLY_CORRECT");
   /* See comment in getopt.c:
      glibc gets a LSB-compliant getopt.
-     Standalone applications get a POSIX-compliant getopt.  */
-#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2 || defined __MINGW32__)
+     Standalone applications get a POSIX-compliant getopt.
+     Note: The 'defined __GETOPT_PREFIX' condition is equivalent to
+     $REPLACE_GETOPT = 1 at configure time.  */
+#if defined __GETOPT_PREFIX || !(__GLIBC__ >= 2)
   /* Using getopt from gnulib or from a non-glibc system.  */
   posixly = true;
 #endif