From 3d99d9fb66ceea0f93a6cfeb496f0471efa212d3 Mon Sep 17 00:00:00 2001
From: Paul Eggert
Date: Mon, 3 Nov 2014 16:34:52 -0800
Subject: [PATCH 1/4] obstack: port to platforms that #define __alignof__
* lib/obstack.c: Include if !defined __alignof__,
not if !_LIBC. We don't know of any platforms that #define
__alignof__, but it might be useful in tests. Conversely,
glibc assumes GCC.
---
ChangeLog | 8 ++++++++
lib/obstack.c | 5 ++++-
2 files changed, 12 insertions(+), 1 deletion(-)
diff --git a/ChangeLog b/ChangeLog
index 6728893..274b794 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-03 Paul Eggert
+
+ obstack: port to platforms that #define __alignof__
+ * lib/obstack.c: Include if !defined __alignof__,
+ not if !_LIBC. We don't know of any platforms that #define
+ __alignof__, but it might be useful in tests. Conversely,
+ glibc assumes GCC.
+
2014-11-03 Pádraig Brady
linkat: don't unconditionally replace on GNU/Linux
diff --git a/lib/obstack.c b/lib/obstack.c
index ba7dff3..d763c57 100644
--- a/lib/obstack.c
+++ b/lib/obstack.c
@@ -48,7 +48,10 @@
#endif
#ifndef _OBSTACK_ELIDE_CODE
-# if !defined _LIBC && !defined __GNUC__
+/* If GCC, or if an oddball (testing?) host that #defines __alignof__,
+ use the already-supplied __alignof__. Otherwise, this must be Gnulib
+ (as glibc assumes GCC); defer to Gnulib's alignof_type. */
+# if !defined __GNUC__ && !defined __alignof__
# include
# define __alignof__(type) alignof_type (type)
# endif
--
1.9.3