* 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>
+
+ 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.
# 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));