summaryrefslogtreecommitdiff
path: root/acinclude.m4
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2009-04-21 10:26:58 +0000
committerYang Tse <yangsita@gmail.com>2009-04-21 10:26:58 +0000
commit1509409fe11db68a6d40e08b5c122ff2ce51a53e (patch)
tree9a2eaef30d558fc33007df1f85b2bc7574d9620c /acinclude.m4
parentdf96c987c6ea4ac121bdacc78b52a6f0f6555d39 (diff)
downloadc-ares-1509409fe11db68a6d40e08b5c122ff2ce51a53e.tar.gz
c-ares-1509409fe11db68a6d40e08b5c122ff2ce51a53e.tar.bz2
c-ares-1509409fe11db68a6d40e08b5c122ff2ce51a53e.zip
Moved potential inclusion of system's malloc.h and memory.h header files to
setup_once.h. Inclusion of each header file is based on the definition of NEED_MALLOC_H and NEED_MEMORY_H respectively.
Diffstat (limited to 'acinclude.m4')
-rw-r--r--acinclude.m452
1 files changed, 52 insertions, 0 deletions
diff --git a/acinclude.m4 b/acinclude.m4
index 879643d..790d1c7 100644
--- a/acinclude.m4
+++ b/acinclude.m4
@@ -360,6 +360,58 @@ AC_DEFUN([CURL_CHECK_HEADER_MALLOC], [
])
+dnl CURL_CHECK_HEADER_MEMORY
+dnl -------------------------------------------------
+dnl Check for compilable and valid memory.h header,
+dnl and check if it is needed even with stdlib.h for
+dnl memory related functions.
+
+AC_DEFUN([CURL_CHECK_HEADER_MEMORY], [
+ AC_CACHE_CHECK([for memory.h], [ac_cv_header_memory_h], [
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#include <memory.h>
+ ]],[[
+ void *p = malloc(10);
+ void *q = calloc(10,10);
+ free(p);
+ free(q);
+ ]])
+ ],[
+ ac_cv_header_memory_h="yes"
+ ],[
+ ac_cv_header_memory_h="no"
+ ])
+ ])
+ if test "$ac_cv_header_memory_h" = "yes"; then
+ AC_DEFINE_UNQUOTED(HAVE_MEMORY_H, 1,
+ [Define to 1 if you have the memory.h header file.])
+ #
+ AC_COMPILE_IFELSE([
+ AC_LANG_PROGRAM([[
+#include <stdlib.h>
+ ]],[[
+ void *p = malloc(10);
+ void *q = calloc(10,10);
+ free(p);
+ free(q);
+ ]])
+ ],[
+ curl_cv_need_header_memory_h="no"
+ ],[
+ curl_cv_need_header_memory_h="yes"
+ ])
+ #
+ case "$curl_cv_need_header_memory_h" in
+ yes)
+ AC_DEFINE_UNQUOTED(NEED_MEMORY_H, 1,
+ [Define to 1 if you need the memory.h header file even with stdlib.h])
+ ;;
+ esac
+ fi
+])
+
+
dnl CURL_CHECK_TYPE_SOCKLEN_T
dnl -------------------------------------------------
dnl Check for existing socklen_t type, and provide