]> Savannah Git Hosting - gnulib.git/commitdiff
errno tests: Avoid test failure on Haiku.
authorBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 15:15:10 +0000 (17:15 +0200)
committerBruno Haible <bruno@clisp.org>
Mon, 12 Aug 2024 15:15:10 +0000 (17:15 +0200)
* doc/posix-headers/errno.texi: Mention the Haiku problem.
* tests/test-errno.c: On Haiku, don't check that the error numbers are
positive.

ChangeLog
doc/posix-headers/errno.texi
tests/test-errno.c

index c4dda29205922a3b63593b601cbca1d7254c7cf3..63b19e0480b03871afbd829a7b29863de2a6f296 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2024-08-12  Bruno Haible  <bruno@clisp.org>
+
+       errno tests: Avoid test failure on Haiku.
+       * doc/posix-headers/errno.texi: Mention the Haiku problem.
+       * tests/test-errno.c: On Haiku, don't check that the error numbers are
+       positive.
+
 2024-08-12  Bruno Haible  <bruno@clisp.org>
 
        errno: Ensure ESOCKTNOSUPPORT gets defined.
index 4495fbfaeeb18a43226f22275738e2ffdc74cdd0..3b8b22dabbf09d75575f8e697ac016fb620577da 100644 (file)
@@ -64,4 +64,7 @@ AIX 7.3.
 
 Portability problems not fixed by Gnulib:
 @itemize
+@item
+All error numbers are negative on some platforms:
+Haiku.
 @end itemize
index acd07ab95b34b6f1f9c482dd8e6f37f674ff359f..b54dc705dcca6062488a65c6d65fc11ccc2811ca 100644 (file)
   /* end of CHECK_POSIX_ERRNOS */
 
 /* Verify that the POSIX mandated errno values can be used as integer
-   constant expressions and are all positive.  */
-#define POSITIVE_INTEGER_CONSTANT_EXPRESSION(e) static_assert (0 < (e) << 0);
+   constant expressions and are all positive (except on Haiku).  */
+#if defined __HAIKU__
+# define NONZERO_INTEGER_CONSTANT_EXPRESSION(e) static_assert (0 != (e) << 0);
+CHECK_POSIX_ERRNOS (NONZERO_INTEGER_CONSTANT_EXPRESSION)
+#else
+# define POSITIVE_INTEGER_CONSTANT_EXPRESSION(e) static_assert (0 < (e) << 0);
 CHECK_POSIX_ERRNOS (POSITIVE_INTEGER_CONSTANT_EXPRESSION)
+#endif
 
 /* Verify that errno values can all be used in #if.  */
 #define USABLE_IN_IF(e) ^ e