stddef_h.m4 revision 2
107N/Adnl A placeholder for POSIX 2008 <stddef.h>, for platforms that have issues.
107N/A# stddef_h.m4 serial 2
107N/Adnl Copyright (C) 2009, 2010 Free Software Foundation, Inc.
107N/Adnl This file is free software; the Free Software Foundation
107N/Adnl gives unlimited permission to copy and/or distribute it,
107N/Adnl with or without modifications, as long as this notice is preserved.
107N/A
107N/AAC_DEFUN([gl_STDDEF_H],
107N/A[
107N/A AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
107N/A AC_REQUIRE([gt_TYPE_WCHAR_T])
107N/A if test $gt_cv_c_wchar_t = no; then
107N/A HAVE_WCHAR_T=0
107N/A STDDEF_H=stddef.h
107N/A fi
107N/A AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
107N/A [gl_cv_decl_null_works],
107N/A [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
107N/A int test[2 * (sizeof NULL == sizeof (void *)) -1];
107N/A]])],
107N/A [gl_cv_decl_null_works=yes],
107N/A [gl_cv_decl_null_works=no])])
107N/A if test $gl_cv_decl_null_works = no; then
107N/A REPLACE_NULL=1
107N/A STDDEF_H=stddef.h
107N/A fi
107N/A if test -n "$STDDEF_H"; then
107N/A gl_CHECK_NEXT_HEADERS([stddef.h])
107N/A fi
107N/A])
107N/A
107N/AAC_DEFUN([gl_STDDEF_MODULE_INDICATOR],
107N/A[
107N/A dnl Use AC_REQUIRE here, so that the default settings are expanded once only.
107N/A AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
107N/A gl_MODULE_INDICATOR_SET_VARIABLE([$1])
107N/A])
107N/A
107N/AAC_DEFUN([gl_STDDEF_H_DEFAULTS],
107N/A[
107N/A dnl Assume proper GNU behavior unless another module says otherwise.
107N/A REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
107N/A HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
107N/A STDDEF_H=''; AC_SUBST([STDDEF_H])
107N/A])
107N/A