1 /* Substitute for and wrapper around <malloc.h>.
2 Copyright (C) 2020-2021 Free Software Foundation, Inc.
4 This program is free software; you can redistribute it and/or modify
5 it under the terms of the GNU General Public License as published by
6 the Free Software Foundation; either version 2, or (at your option)
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program; if not, see <https://www.gnu.org/licenses/>. */
17 #ifndef _@GUARD_PREFIX@_MALLOC_H
20 @PRAGMA_SYSTEM_HEADER@
24 /* The include_next requires a split double-inclusion guard. */
26 # @INCLUDE_NEXT@ @NEXT_MALLOC_H@
29 #ifndef _@GUARD_PREFIX@_MALLOC_H
30 #define _@GUARD_PREFIX@_MALLOC_H
32 /* Solaris declares memalign() in <stdlib.h>, not in <malloc.h>.
36 /* The definitions of _GL_FUNCDECL_RPL etc. are copied here. */
38 /* The definition of _GL_WARN_ON_USE is copied here. */
41 /* Declare overridden functions. */
44 # if @REPLACE_MEMALIGN@
45 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
47 # define memalign rpl_memalign
49 _GL_FUNCDECL_RPL (memalign
, void *, (size_t alignment
, size_t size
));
50 _GL_CXXALIAS_RPL (memalign
, void *, (size_t alignment
, size_t size
));
53 _GL_CXXALIAS_SYS (memalign
, void *, (size_t alignment
, size_t size
));
57 _GL_CXXALIASWARN (memalign
);
59 #elif defined GNULIB_POSIXCHECK
61 # if HAVE_RAW_DECL_MEMALIGN
62 _GL_WARN_ON_USE (memalign
, "memalign is not portable - "
63 "use gnulib module memalign for portability");
68 #endif /* _@GUARD_PREFIX@_MALLOC_H */
69 #endif /* _@GUARD_PREFIX@_MALLOC_H */