diff options
Diffstat (limited to 'macros/texinfo/texinfo/gnulib/m4/stddef_h.m4')
-rw-r--r-- | macros/texinfo/texinfo/gnulib/m4/stddef_h.m4 | 20 |
1 files changed, 16 insertions, 4 deletions
diff --git a/macros/texinfo/texinfo/gnulib/m4/stddef_h.m4 b/macros/texinfo/texinfo/gnulib/m4/stddef_h.m4 index 979e3cf7e7..cd666c4a58 100644 --- a/macros/texinfo/texinfo/gnulib/m4/stddef_h.m4 +++ b/macros/texinfo/texinfo/gnulib/m4/stddef_h.m4 @@ -1,14 +1,19 @@ -dnl A placeholder for <stddef.h>, for platforms that have issues. -# stddef_h.m4 serial 6 -dnl Copyright (C) 2009-2019 Free Software Foundation, Inc. +# stddef_h.m4 serial 9 +dnl Copyright (C) 2009-2021 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, dnl with or without modifications, as long as this notice is preserved. +dnl A placeholder for <stddef.h>, for platforms that have issues. + AC_DEFUN([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]) + STDDEF_H= dnl Test whether the type max_align_t exists and whether its alignment @@ -19,10 +24,17 @@ AC_DEFUN([gl_STDDEF_H], [AC_LANG_PROGRAM( [[#include <stddef.h> unsigned int s = sizeof (max_align_t); - #if defined __GNUC__ || defined __IBM__ALIGNOF__ + #if defined __GNUC__ || defined __clang__ || defined __IBM__ALIGNOF__ int check1[2 * (__alignof__ (double) <= __alignof__ (max_align_t)) - 1]; int check2[2 * (__alignof__ (long double) <= __alignof__ (max_align_t)) - 1]; #endif + typedef struct { char a; max_align_t b; } max_helper; + typedef struct { char a; long b; } long_helper; + typedef struct { char a; double b; } double_helper; + typedef struct { char a; long double b; } long_double_helper; + int check3[2 * (offsetof (long_helper, b) <= offsetof (max_helper, b)) - 1]; + int check4[2 * (offsetof (double_helper, b) <= offsetof (max_helper, b)) - 1]; + int check5[2 * (offsetof (long_double_helper, b) <= offsetof (max_helper, b)) - 1]; ]])], [gl_cv_type_max_align_t=yes], [gl_cv_type_max_align_t=no]) |