summaryrefslogtreecommitdiff
path: root/gnulib-m4/stddef_h.m4
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-10-20 15:21:43 +0200
committerJörg Frings-Fürst <debian@jff.email>2024-10-20 15:21:43 +0200
commit4682deeb62247d34de87f8e777f99e2d337fd377 (patch)
tree5bd5b5605b5f3a4b3c8ea7468c34c23094afdef4 /gnulib-m4/stddef_h.m4
parent00893e79fc62966067af1a106567db96bd170338 (diff)
New upstream version 1.3upstream/1.3upstream
Diffstat (limited to 'gnulib-m4/stddef_h.m4')
-rw-r--r--gnulib-m4/stddef_h.m442
1 files changed, 34 insertions, 8 deletions
diff --git a/gnulib-m4/stddef_h.m4 b/gnulib-m4/stddef_h.m4
index 1bf9eb39..c7f75b37 100644
--- a/gnulib-m4/stddef_h.m4
+++ b/gnulib-m4/stddef_h.m4
@@ -1,4 +1,5 @@
-# stddef_h.m4 serial 14
+# stddef_h.m4
+# serial 17
dnl Copyright (C) 2009-2024 Free Software Foundation, Inc.
dnl This file is free software; the Free Software Foundation
dnl gives unlimited permission to copy and/or distribute it,
@@ -9,7 +10,6 @@ dnl A placeholder for <stddef.h>, for platforms that have issues.
AC_DEFUN_ONCE([gl_STDDEF_H],
[
AC_REQUIRE([gl_STDDEF_H_DEFAULTS])
- AC_REQUIRE([gt_TYPE_WCHAR_T])
dnl Persuade OpenBSD <stddef.h> to declare max_align_t.
AC_REQUIRE([gl_USE_SYSTEM_EXTENSIONS])
@@ -51,11 +51,6 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
- if test $gt_cv_c_wchar_t = no; then
- HAVE_WCHAR_T=0
- GL_GENERATE_STDDEF_H=true
- fi
-
AC_CACHE_CHECK([whether NULL can be used in arbitrary expressions],
[gl_cv_decl_null_works],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <stddef.h>
@@ -83,6 +78,36 @@ AC_DEFUN_ONCE([gl_STDDEF_H],
GL_GENERATE_STDDEF_H=true
fi
+ dnl https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114869
+ AC_CACHE_CHECK([whether nullptr_t needs <stddef.h>],
+ [gl_cv_nullptr_t_needs_stddef],
+ [AC_COMPILE_IFELSE([AC_LANG_DEFINES_PROVIDED[nullptr_t x;]],
+ [gl_cv_nullptr_t_needs_stddef=no],
+ [gl_cv_nullptr_t_needs_stddef=yes])])
+ if test "$gl_cv_nullptr_t_needs_stddef" = no; then
+ NULLPTR_T_NEEDS_STDDEF=0
+ GL_GENERATE_STDDEF_H=true
+ fi
+
+ AC_CACHE_CHECK([for clean definition of __STDC_VERSION_STDDEF_H__],
+ [gl_cv_clean_version_stddef],
+ [AC_PREPROC_IFELSE(
+ [AC_LANG_SOURCE(
+ [[/* https://gcc.gnu.org/bugzilla/show_bug.cgi?id=114870 */
+ #include <stddef.h>
+ #undef __STDC_VERSION_STDDEF_H__
+ #include <time.h>
+ #ifdef __STDC_VERSION_STDDEF_H__
+ # error "<time.h> defines __STDC_VERSION_STDDEF_H__"
+ #endif
+ ]])],
+ [gl_cv_clean_version_stddef=yes],
+ [gl_cv_clean_version_stddef=no])])
+ if test "$gl_cv_clean_version_stddef" = no; then
+ STDDEF_NOT_IDEMPOTENT=1
+ GL_GENERATE_STDDEF_H=true
+ fi
+
if $GL_GENERATE_STDDEF_H; then
gl_NEXT_HEADERS([stddef.h])
fi
@@ -113,7 +138,8 @@ AC_DEFUN([gl_STDDEF_H_REQUIRE_DEFAULTS],
AC_DEFUN([gl_STDDEF_H_DEFAULTS],
[
dnl Assume proper GNU behavior unless another module says otherwise.
+ NULLPTR_T_NEEDS_STDDEF=1; AC_SUBST([NULLPTR_T_NEEDS_STDDEF])
+ STDDEF_NOT_IDEMPOTENT=0; AC_SUBST([STDDEF_NOT_IDEMPOTENT])
REPLACE_NULL=0; AC_SUBST([REPLACE_NULL])
HAVE_MAX_ALIGN_T=1; AC_SUBST([HAVE_MAX_ALIGN_T])
- HAVE_WCHAR_T=1; AC_SUBST([HAVE_WCHAR_T])
])