diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2002-01-16 22:28:24 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2002-01-16 22:28:24 (GMT) |
commit | 7758f790c9320b0269848afb760f7c2b32a3d7a3 (patch) | |
tree | 716be0bb103365d8bd885d05e62d206a0cd138fd /configure.in | |
parent | 8d9a7d3eb74b40a685c523600afa56ce5436884d (diff) | |
download | hdf5-7758f790c9320b0269848afb760f7c2b32a3d7a3.zip hdf5-7758f790c9320b0269848afb760f7c2b32a3d7a3.tar.gz hdf5-7758f790c9320b0269848afb760f7c2b32a3d7a3.tar.bz2 |
[svn-r4840] Purpose:
New feature check
Description:
Added check to determine if malloc(0) returns a valid pointer for a
particular architecture.
Platforms tested:
FreeBSD 4.5 (sleipnir) where malloc(0) works
Cray SV1 (killeen) where malloc(0) doesn't work
Diffstat (limited to 'configure.in')
-rw-r--r-- | configure.in | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/configure.in b/configure.in index 90628ab..a0d48a2 100644 --- a/configure.in +++ b/configure.in @@ -1228,6 +1228,31 @@ AC_MSG_RESULT(%${hdf5_cv_printf_ll}d and %${hdf5_cv_printf_ll}u) AC_DEFINE_UNQUOTED(PRINTF_LL_WIDTH,"$hdf5_cv_printf_ll") dnl ---------------------------------------------------------------------- +dnl Check if malloc(0) returns valid pointer +dnl +AC_MSG_CHECKING(if malloc of zero bytes returns valid pointer) +AC_CACHE_VAL(hdf5_cv_malloc_works, +AC_TRY_RUN([ +#if STDC_HEADERS +#include <stdlib.h> +#endif + +int main(void) +{ + exit(malloc (0) ? 0 : 1); +} + ], hdf5_cv_malloc_works=yes,hdf5_cv_malloc_works=no,) +) + +if test ${hdf5_cv_malloc_works} = "yes"; then + AC_DEFINE(MALLOC_WORKS, 1, + [Define if your system has a working `malloc' function.]) + AC_MSG_RESULT(yes) +else + AC_MSG_RESULT(no) +fi + +dnl ---------------------------------------------------------------------- dnl Turn on debugging by setting compiler flags dnl AC_MSG_CHECKING(for debug flags) |