]> Savannah Git Hosting - gnulib.git/commitdiff
swab: Fix compilation error with Sun C++ on Solaris 11.3.
authorBruno Haible <bruno@clisp.org>
Sun, 18 Sep 2022 00:32:13 +0000 (02:32 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 18 Sep 2022 19:22:29 +0000 (21:22 +0200)
* lib/unistd.in.h (swab): For the C++ declaration, under Solaris 11 but
not under Solaris 10, test also __XOPEN_OR_POSIX.

ChangeLog
lib/unistd.in.h

index 35a275a1c1593498a23f394d9f0d546a462860ff..f280a860e0e5f4947c64abc15188ab6db067bbda 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2022-09-17  Bruno Haible  <bruno@clisp.org>
+
+       swab: Fix compilation error with Sun C++ on Solaris 11.3.
+       * lib/unistd.in.h (swab): For the C++ declaration, under Solaris 11 but
+       not under Solaris 10, test also __XOPEN_OR_POSIX.
+
 2022-09-17  Bruno Haible  <bruno@clisp.org>
 
        time C++ tests: Fix link error on CentOS 5.
index ef3e68fcd2ca945742d79ebeffb0d6baaef34567..50f6e56550e0fe73bd0a7d75db25943a60e10242 100644 (file)
@@ -2057,7 +2057,7 @@ _GL_CXXALIAS_MDA_CAST (swab, void, (char *from, char *to, int n));
 # else
 #  if defined __hpux /* HP-UX */
 _GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, int n));
-#  elif defined __sun && !defined _XPG4 /* Solaris */
+#  elif defined __sun && (defined __SunOS_5_10 || defined __XOPEN_OR_POSIX) && !defined _XPG4 /* Solaris */
 _GL_CXXALIAS_SYS (swab, void, (const char *from, char *to, ssize_t n));
 #  else
 _GL_CXXALIAS_SYS (swab, void, (const void *from, void *to, ssize_t n));