summaryrefslogtreecommitdiff
path: root/lib/stddef.in.h
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2014-12-11 23:16:37 -0800
committerPaul Eggert <eggert@cs.ucla.edu>2014-12-12 16:04:10 -0800
commitb81a1837916a7f3f7abd953338302fa237a532f2 (patch)
treeeab3a9abb613126d80773cc6dd04d3a7b9f22ad3 /lib/stddef.in.h
parent074965f9355b7cc7f7a5f4385a19433e51c8afd2 (diff)
downloademacs-b81a1837916a7f3f7abd953338302fa237a532f2.tar.gz
Merge from gnulib
2014-12-12 stddef: support C11's max_align_t 2014-12-08 apply _GL_ATTRIBUTE_PURE to some inline functions 2014-12-02 support GNU format printf and scanf on mingw * doc/misc/texinfo.tex, lib/stat-time.h, lib/stddef.in.h: * lib/timespec.h, m4/extensions.m4, m4/stddef_h.m4, m4/stdio_h.m4: Update from gnulib. * lib/gnulib.mk: Regenerate.
Diffstat (limited to 'lib/stddef.in.h')
-rw-r--r--lib/stddef.in.h41
1 files changed, 26 insertions, 15 deletions
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index f5c0e056554..9924a327fca 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -39,7 +39,6 @@
# if !(defined _@GUARD_PREFIX@_STDDEF_H && defined _GL_STDDEF_WINT_T)
# ifdef __need_wint_t
-# undef _@GUARD_PREFIX@_STDDEF_H
# define _GL_STDDEF_WINT_T
# endif
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
@@ -54,33 +53,45 @@
# @INCLUDE_NEXT@ @NEXT_STDDEF_H@
-# ifndef _@GUARD_PREFIX@_STDDEF_H
-# define _@GUARD_PREFIX@_STDDEF_H
-
/* On NetBSD 5.0, the definition of NULL lacks proper parentheses. */
-#if @REPLACE_NULL@
-# undef NULL
-# ifdef __cplusplus
+# if (@REPLACE_NULL@ \
+ && (!defined _@GUARD_PREFIX@_STDDEF_H || defined _GL_STDDEF_WINT_T))
+# undef NULL
+# ifdef __cplusplus
/* ISO C++ says that the macro NULL must expand to an integer constant
expression, hence '((void *) 0)' is not allowed in C++. */
-# if __GNUG__ >= 3
+# if __GNUG__ >= 3
/* GNU C++ has a __null macro that behaves like an integer ('int' or
'long') but has the same size as a pointer. Use that, to avoid
warnings. */
-# define NULL __null
-# else
-# define NULL 0L
+# define NULL __null
+# else
+# define NULL 0L
+# endif
+# else
+# define NULL ((void *) 0)
+# endif
# endif
-# else
-# define NULL ((void *) 0)
-# endif
-#endif
+
+# ifndef _@GUARD_PREFIX@_STDDEF_H
+# define _@GUARD_PREFIX@_STDDEF_H
/* Some platforms lack wchar_t. */
#if !@HAVE_WCHAR_T@
# define wchar_t int
#endif
+/* Some platforms lack max_align_t. */
+#if !@HAVE_MAX_ALIGN_T@
+typedef union
+{
+ char *__p;
+ double __d;
+ long double __ld;
+ long int __i;
+} max_align_t;
+#endif
+
# endif /* _@GUARD_PREFIX@_STDDEF_H */
# endif /* _@GUARD_PREFIX@_STDDEF_H */
#endif /* __need_XXX */