r17886: add talloc_ptrtype() and talloc_array_ptrtype(),
[samba.git] / source / lib / talloc / config.m4
1 AC_CHECK_HEADERS(stdarg.h vararg.h)
2
3 dnl VA_COPY
4 AC_CACHE_CHECK([for va_copy],samba_cv_HAVE_VA_COPY,[
5 AC_TRY_LINK([#include <stdarg.h>
6 va_list ap1,ap2;], [va_copy(ap1,ap2);],
7 samba_cv_HAVE_VA_COPY=yes,samba_cv_HAVE_VA_COPY=no)])
8 if test x"$samba_cv_HAVE_VA_COPY" = x"yes"; then
9     AC_DEFINE(HAVE_VA_COPY,1,[Whether va_copy() is available])
10 fi
11
12 if test x"$samba_cv_HAVE_VA_COPY" != x"yes"; then
13 AC_CACHE_CHECK([for __va_copy],samba_cv_HAVE___VA_COPY,[
14 AC_TRY_LINK([#include <stdarg.h>
15 va_list ap1,ap2;], [__va_copy(ap1,ap2);],
16 samba_cv_HAVE___VA_COPY=yes,samba_cv_HAVE___VA_COPY=no)])
17 if test x"$samba_cv_HAVE___VA_COPY" = x"yes"; then
18     AC_DEFINE(HAVE___VA_COPY,1,[Whether __va_copy() is available])
19 fi
20 fi
21
22 AC_CHECK_TYPE(intptr_t, unsigned long long)
23 AC_CHECK_SIZEOF(size_t,cross)
24 AC_CHECK_SIZEOF(void *,cross)
25
26 if test $ac_cv_sizeof_size_t -lt $ac_cv_sizeof_void_p; then
27         AC_WARN([size_t cannot represent the amount of used memory of a process])
28         AC_WARN([please report this to <samba-technical@samba.org>])
29         AC_WARN([sizeof(size_t) = $ac_cv_sizeof_size_t])
30         AC_WARN([sizeof(void *) = $ac_cv_sizeof_void_p])
31         AC_ERROR([sizeof(size_t) < sizeof(void *)])
32 fi