timespec_get: New module.
[gnulib.git] / lib / malloc.in.h
blob3c602687dcb7d5626d7178fdf243ed402ca0d842
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)
7 any later version.
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
19 #if __GNUC__ >= 3
20 @PRAGMA_SYSTEM_HEADER@
21 #endif
22 @PRAGMA_COLUMNS@
24 /* The include_next requires a split double-inclusion guard. */
25 #if @HAVE_MALLOC_H@
26 # @INCLUDE_NEXT@ @NEXT_MALLOC_H@
27 #endif
29 #ifndef _@GUARD_PREFIX@_MALLOC_H
30 #define _@GUARD_PREFIX@_MALLOC_H
32 /* Solaris declares memalign() in <stdlib.h>, not in <malloc.h>.
33 Also get size_t. */
34 #include <stdlib.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. */
43 #if @GNULIB_MEMALIGN@
44 # if @REPLACE_MEMALIGN@
45 # if !(defined __cplusplus && defined GNULIB_NAMESPACE)
46 # undef memalign
47 # define memalign rpl_memalign
48 # endif
49 _GL_FUNCDECL_RPL (memalign, void *, (size_t alignment, size_t size));
50 _GL_CXXALIAS_RPL (memalign, void *, (size_t alignment, size_t size));
51 # else
52 # if @HAVE_MEMALIGN@
53 _GL_CXXALIAS_SYS (memalign, void *, (size_t alignment, size_t size));
54 # endif
55 # endif
56 # if @HAVE_MEMALIGN@
57 _GL_CXXALIASWARN (memalign);
58 # endif
59 #elif defined GNULIB_POSIXCHECK
60 # undef memalign
61 # if HAVE_RAW_DECL_MEMALIGN
62 _GL_WARN_ON_USE (memalign, "memalign is not portable - "
63 "use gnulib module memalign for portability");
64 # endif
65 #endif
68 #endif /* _@GUARD_PREFIX@_MALLOC_H */
69 #endif /* _@GUARD_PREFIX@_MALLOC_H */