]> Savannah Git Hosting - gnulib.git/commitdiff
Fix compilation errors in C++ mode on Haiku.
authorBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2019 02:02:08 +0000 (03:02 +0100)
committerBruno Haible <bruno@clisp.org>
Mon, 9 Dec 2019 02:02:08 +0000 (03:02 +0100)
* lib/stdio.in.h (vdprintf): Disable _GL_CXXALIASWARN invocation on
non-glibc systems.
* lib/spawn.in.h (posix_spawnattr_getschedpolicy,
posix_spawnattr_setschedpolicy, posix_spawnattr_getschedparam,
posix_spawnattr_setschedparam): Likewise.
* lib/stdlib.in.h (random, initstate_r, setstate_r): Use
_GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS.
* lib/unistd.in.h (usleep): Likewise.

ChangeLog
lib/spawn.in.h
lib/stdio.in.h
lib/stdlib.in.h
lib/unistd.in.h

index d4ca157cf5ef7c756fd01c7aae6d9e680490c017..0bbb7249b2ce8c5278d40c9bf710439f0936b158 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2019-12-08  Bruno Haible  <bruno@clisp.org>
+
+       Fix compilation errors in C++ mode on Haiku.
+       * lib/stdio.in.h (vdprintf): Disable _GL_CXXALIASWARN invocation on
+       non-glibc systems.
+       * lib/spawn.in.h (posix_spawnattr_getschedpolicy,
+       posix_spawnattr_setschedpolicy, posix_spawnattr_getschedparam,
+       posix_spawnattr_setschedparam): Likewise.
+       * lib/stdlib.in.h (random, initstate_r, setstate_r): Use
+       _GL_CXXALIAS_SYS_CAST instead of _GL_CXXALIAS_SYS.
+       * lib/unistd.in.h (usleep): Likewise.
+
 2019-12-08  Bruno Haible  <bruno@clisp.org>
 
        Fix compilation errors in 32-bit C++ mode on HP-UX 11/ia64.
index 09c66f5adcb01b803ba47617a8ae642ee85a229b..c4e1f134b83ab5f6e74fc7ed50b492f83d555bd2 100644 (file)
@@ -604,7 +604,9 @@ _GL_CXXALIAS_SYS (posix_spawnattr_getschedpolicy, int,
                   (const posix_spawnattr_t *_Restrict_ __attr,
                    int *_Restrict_ __schedpolicy));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_getschedpolicy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_getschedpolicy
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPOLICY
@@ -634,7 +636,9 @@ _GL_FUNCDECL_SYS (posix_spawnattr_setschedpolicy, int,
 _GL_CXXALIAS_SYS (posix_spawnattr_setschedpolicy, int,
                   (posix_spawnattr_t *__attr, int __schedpolicy));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_setschedpolicy);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_setschedpolicy
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPOLICY
@@ -668,7 +672,9 @@ _GL_CXXALIAS_SYS (posix_spawnattr_getschedparam, int,
                   (const posix_spawnattr_t *_Restrict_ __attr,
                    struct sched_param *_Restrict_ __schedparam));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_getschedparam);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_getschedparam
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_GETSCHEDPARAM
@@ -702,7 +708,9 @@ _GL_CXXALIAS_SYS (posix_spawnattr_setschedparam, int,
                   (posix_spawnattr_t *_Restrict_ __attr,
                    const struct sched_param *_Restrict_ __schedparam));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (posix_spawnattr_setschedparam);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef posix_spawnattr_setschedparam
 # if HAVE_RAW_DECL_POSIX_SPAWNATTR_SETSCHEDPARAM
index 4aea52c1a71f860d1f1ea1801305813a2ffffe1f..447a4723ab919aacbdc711719b336edb0f1952cb 100644 (file)
@@ -1259,7 +1259,9 @@ _GL_FUNCDECL_SYS (vdprintf, int, (int fd, const char *format, va_list args)
 _GL_CXXALIAS_SYS_CAST (vdprintf, int,
                        (int fd, const char *format, va_list args));
 # endif
+# if __GLIBC__ >= 2
 _GL_CXXALIASWARN (vdprintf);
+# endif
 #elif defined GNULIB_POSIXCHECK
 # undef vdprintf
 # if HAVE_RAW_DECL_VDPRINTF
index 2d02b4b01261d4f4f4b859f06c42386850ca9d9a..5edae2c4efe008f4b97c543b4f62ae7d486f3eb3 100644 (file)
@@ -599,7 +599,9 @@ _GL_CXXALIAS_RPL (random, long, (void));
 #  if !@HAVE_RANDOM@
 _GL_FUNCDECL_SYS (random, long, (void));
 #  endif
-_GL_CXXALIAS_SYS (random, long, (void));
+/* Need to cast, because on Haiku, the return type is
+                               int.  */
+_GL_CXXALIAS_SYS_CAST (random, long, (void));
 # endif
 _GL_CXXALIASWARN (random);
 #elif defined GNULIB_POSIXCHECK
@@ -766,9 +768,11 @@ _GL_FUNCDECL_SYS (initstate_r, int,
                    struct random_data *rand_state)
                   _GL_ARG_NONNULL ((2, 4)));
 #  endif
-_GL_CXXALIAS_SYS (initstate_r, int,
-                  (unsigned int seed, char *buf, size_t buf_size,
-                   struct random_data *rand_state));
+/* Need to cast, because on Haiku, the third parameter is
+                                                     unsigned long buf_size.  */
+_GL_CXXALIAS_SYS_CAST (initstate_r, int,
+                       (unsigned int seed, char *buf, size_t buf_size,
+                        struct random_data *rand_state));
 # endif
 _GL_CXXALIASWARN (initstate_r);
 #elif defined GNULIB_POSIXCHECK
@@ -796,8 +800,10 @@ _GL_FUNCDECL_SYS (setstate_r, int,
                   (char *arg_state, struct random_data *rand_state)
                   _GL_ARG_NONNULL ((1, 2)));
 #  endif
-_GL_CXXALIAS_SYS (setstate_r, int,
-                  (char *arg_state, struct random_data *rand_state));
+/* Need to cast, because on Haiku, the first parameter is
+                        void *arg_state.  */
+_GL_CXXALIAS_SYS_CAST (setstate_r, int,
+                       (char *arg_state, struct random_data *rand_state));
 # endif
 _GL_CXXALIASWARN (setstate_r);
 #elif defined GNULIB_POSIXCHECK
index c57d6f9ff34d55c1a65a34ccecd66386ac2e0212..28ab704c3bb1ed8bd22f3bf3a2ead6b5e501f3d5 100644 (file)
@@ -1677,7 +1677,9 @@ _GL_CXXALIAS_RPL (usleep, int, (useconds_t n));
 #  if !@HAVE_USLEEP@
 _GL_FUNCDECL_SYS (usleep, int, (useconds_t n));
 #  endif
-_GL_CXXALIAS_SYS (usleep, int, (useconds_t n));
+/* Need to cast, because on Haiku, the first parameter is
+                                     unsigned int n.  */
+_GL_CXXALIAS_SYS_CAST (usleep, int, (useconds_t n));
 # endif
 _GL_CXXALIASWARN (usleep);
 #elif defined GNULIB_POSIXCHECK