New module 'eealloc'.
[gnulib.git] / m4 / eealloc.m4
1 # eealloc.m4 serial 1
2 dnl Copyright (C) 2003 Free Software Foundation, Inc.
3 dnl This file is free software, distributed under the terms of the GNU
4 dnl General Public License.  As a special exception to the GNU General
5 dnl Public License, this file may be distributed as part of a program
6 dnl that contains a configuration script generated by Autoconf, under
7 dnl the same distribution terms as the rest of that program.
8
9 AC_DEFUN([gl_EEALLOC],
10 [
11   AC_REQUIRE([gl_EEMALLOC])
12   AC_REQUIRE([gl_EEREALLOC])
13   AC_REQUIRE([AC_C_INLINE])
14 ])
15
16 AC_DEFUN([gl_EEMALLOC],
17 [
18   _AC_FUNC_MALLOC_IF(
19     [gl_cv_func_malloc_0_nonnull=1],
20     [gl_cv_func_malloc_0_nonnull=0])
21   AC_DEFINE_UNQUOTED([MALLOC_0_IS_NONNULL], $gl_cv_func_malloc_0_nonnull,
22     [If malloc(0) is != NULL, define this to 1.  Otherwise define this
23      to 0.])
24 ])
25
26 AC_DEFUN([gl_EEREALLOC],
27 [
28   _AC_FUNC_REALLOC_IF(
29     [gl_cv_func_realloc_0_nonnull=1],
30     [gl_cv_func_realloc_0_nonnull=0])
31   AC_DEFINE_UNQUOTED([REALLOC_0_IS_NONNULL], $gl_cv_func_realloc_0_nonnull,
32     [If realloc(NULL,0) is != NULL, define this to 1.  Otherwise define this
33      to 0.])
34 ])