summaryrefslogtreecommitdiffstats
path: root/gl/stdlib.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/stdlib.in.h')
-rw-r--r--gl/stdlib.in.h37
1 files changed, 25 insertions, 12 deletions
diff --git a/gl/stdlib.in.h b/gl/stdlib.in.h
index 0855112..a86643c 100644
--- a/gl/stdlib.in.h
+++ b/gl/stdlib.in.h
@@ -1,6 +1,6 @@
1/* A GNU-like <stdlib.h>. 1/* A GNU-like <stdlib.h>.
2 2
3 Copyright (C) 1995, 2001-2004, 2006-2021 Free Software Foundation, Inc. 3 Copyright (C) 1995, 2001-2004, 2006-2022 Free Software Foundation, Inc.
4 4
5 This file is free software: you can redistribute it and/or modify 5 This file is free software: you can redistribute it and/or modify
6 it under the terms of the GNU Lesser General Public License as 6 it under the terms of the GNU Lesser General Public License as
@@ -184,7 +184,11 @@ _GL_WARN_ON_USE (_Exit, "_Exit is unportable - "
184# undef free 184# undef free
185# define free rpl_free 185# define free rpl_free
186# endif 186# endif
187# if defined __cplusplus && (__GLIBC__ + (__GLIBC_MINOR__ >= 14) > 2)
188_GL_FUNCDECL_RPL (free, void, (void *ptr) throw ());
189# else
187_GL_FUNCDECL_RPL (free, void, (void *ptr)); 190_GL_FUNCDECL_RPL (free, void, (void *ptr));
191# endif
188_GL_CXXALIAS_RPL (free, void, (void *ptr)); 192_GL_CXXALIAS_RPL (free, void, (void *ptr));
189# else 193# else
190_GL_CXXALIAS_SYS (free, void, (void *ptr)); 194_GL_CXXALIAS_SYS (free, void, (void *ptr));
@@ -260,7 +264,8 @@ _GL_WARN_ON_USE (atoll, "atoll is unportable - "
260#endif 264#endif
261 265
262#if @GNULIB_CALLOC_POSIX@ 266#if @GNULIB_CALLOC_POSIX@
263# if @REPLACE_CALLOC@ 267# if (@GNULIB_CALLOC_POSIX@ && @REPLACE_CALLOC_FOR_CALLOC_POSIX@) \
268 || (@GNULIB_CALLOC_GNU@ && @REPLACE_CALLOC_FOR_CALLOC_GNU@)
264# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 269# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
265# undef calloc 270# undef calloc
266# define calloc rpl_calloc 271# define calloc rpl_calloc
@@ -474,7 +479,8 @@ _GL_WARN_ON_USE (grantpt, "grantpt is not portable - "
474 by never specifying a zero size), so it does not need malloc or 479 by never specifying a zero size), so it does not need malloc or
475 realloc to be redefined. */ 480 realloc to be redefined. */
476#if @GNULIB_MALLOC_POSIX@ 481#if @GNULIB_MALLOC_POSIX@
477# if @REPLACE_MALLOC@ 482# if (@GNULIB_MALLOC_POSIX@ && @REPLACE_MALLOC_FOR_MALLOC_POSIX@) \
483 || (@GNULIB_MALLOC_GNU@ && @REPLACE_MALLOC_FOR_MALLOC_GNU@)
478# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ 484# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
479 || _GL_USE_STDLIB_ALLOC) 485 || _GL_USE_STDLIB_ALLOC)
480# undef malloc 486# undef malloc
@@ -828,29 +834,35 @@ _GL_CXXALIASWARN (putenv);
828/* Sort an array of NMEMB elements, starting at address BASE, each element 834/* Sort an array of NMEMB elements, starting at address BASE, each element
829 occupying SIZE bytes, in ascending order according to the comparison 835 occupying SIZE bytes, in ascending order according to the comparison
830 function COMPARE. */ 836 function COMPARE. */
837# ifdef __cplusplus
838extern "C" {
839# endif
840# if !GNULIB_defined_qsort_r_fn_types
841typedef int (*_gl_qsort_r_compar_fn) (void const *, void const *, void *);
842# define GNULIB_defined_qsort_r_fn_types 1
843# endif
844# ifdef __cplusplus
845}
846# endif
831# if @REPLACE_QSORT_R@ 847# if @REPLACE_QSORT_R@
832# if !(defined __cplusplus && defined GNULIB_NAMESPACE) 848# if !(defined __cplusplus && defined GNULIB_NAMESPACE)
833# undef qsort_r 849# undef qsort_r
834# define qsort_r rpl_qsort_r 850# define qsort_r rpl_qsort_r
835# endif 851# endif
836_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, 852_GL_FUNCDECL_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
837 int (*compare) (void const *, void const *, 853 _gl_qsort_r_compar_fn compare,
838 void *),
839 void *arg) _GL_ARG_NONNULL ((1, 4))); 854 void *arg) _GL_ARG_NONNULL ((1, 4)));
840_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size, 855_GL_CXXALIAS_RPL (qsort_r, void, (void *base, size_t nmemb, size_t size,
841 int (*compare) (void const *, void const *, 856 _gl_qsort_r_compar_fn compare,
842 void *),
843 void *arg)); 857 void *arg));
844# else 858# else
845# if !@HAVE_QSORT_R@ 859# if !@HAVE_QSORT_R@
846_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 860_GL_FUNCDECL_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
847 int (*compare) (void const *, void const *, 861 _gl_qsort_r_compar_fn compare,
848 void *),
849 void *arg) _GL_ARG_NONNULL ((1, 4))); 862 void *arg) _GL_ARG_NONNULL ((1, 4)));
850# endif 863# endif
851_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size, 864_GL_CXXALIAS_SYS (qsort_r, void, (void *base, size_t nmemb, size_t size,
852 int (*compare) (void const *, void const *, 865 _gl_qsort_r_compar_fn compare,
853 void *),
854 void *arg)); 866 void *arg));
855# endif 867# endif
856_GL_CXXALIASWARN (qsort_r); 868_GL_CXXALIASWARN (qsort_r);
@@ -1101,7 +1113,8 @@ _GL_WARN_ON_USE (setstate_r, "setstate_r is unportable - "
1101 1113
1102 1114
1103#if @GNULIB_REALLOC_POSIX@ 1115#if @GNULIB_REALLOC_POSIX@
1104# if @REPLACE_REALLOC@ 1116# if (@GNULIB_REALLOC_POSIX@ && @REPLACE_REALLOC_FOR_REALLOC_POSIX@) \
1117 || (@GNULIB_REALLOC_GNU@ && @REPLACE_REALLOC_FOR_REALLOC_GNU@)
1105# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \ 1118# if !((defined __cplusplus && defined GNULIB_NAMESPACE) \
1106 || _GL_USE_STDLIB_ALLOC) 1119 || _GL_USE_STDLIB_ALLOC)
1107# undef realloc 1120# undef realloc