Ángel González wrote:
For this specific issue, another solution would be to add a #ifndef
_GCC_MAX_ALIGN_T
guard to the replacement unistd.h.
Although the latter doesn't fix the underlying problem.

That may be the best we can do on short notice, so I did that by installing the attached. Thanks for the diagnosis.
From caf0ca071d641550d9b51cf93ae9222a74b6cf2d Mon Sep 17 00:00:00 2001
From: Paul Eggert <egg...@cs.ucla.edu>
Date: Fri, 1 Apr 2016 21:01:17 -0700
Subject: [PATCH] stddef: support configuring with g++
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Problem reported by Ángel González in:
http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00003.html
* lib/stddef.in.h (_GL_STDDEF_ALIGNAS, max_align_t):
Do not define if _GCC_MAX_ALIGN_T is defined.
---
 ChangeLog       | 8 ++++++++
 lib/stddef.in.h | 6 ++++--
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index ca6c36b..ef7629f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2016-04-01  Paul Eggert  <egg...@cs.ucla.edu>
+
+       stddef: support configuring with g++
+       Problem reported by Ángel González in:
+       http://lists.gnu.org/archive/html/bug-gnulib/2016-04/msg00003.html
+       * lib/stddef.in.h (_GL_STDDEF_ALIGNAS, max_align_t):
+       Do not define if _GCC_MAX_ALIGN_T is defined.
+
 2016-03-25  Paul Eggert  <egg...@cs.ucla.edu>
 
        test-framework-sh: minor cleanups
diff --git a/lib/stddef.in.h b/lib/stddef.in.h
index 2beb7f5..0e75b9c 100644
--- a/lib/stddef.in.h
+++ b/lib/stddef.in.h
@@ -81,8 +81,10 @@
 # define wchar_t int
 #endif
 
-/* Some platforms lack max_align_t.  */
-#if !@HAVE_MAX_ALIGN_T@
+/* Some platforms lack max_align_t.  The check for _GCC_MAX_ALIGN_T is
+   a hack in case the configure-time test was done with g++ even though
+   we are currently compiling with gcc.  */
+#if ! (@HAVE_MAX_ALIGN_T@ || defined _GCC_MAX_ALIGN_T)
 /* On the x86, the maximum storage alignment of double, long, etc. is 4,
    but GCC's C11 ABI for x86 says that max_align_t has an alignment of 8,
    and the C11 standard allows this.  Work around this problem by
-- 
2.5.5

Reply via email to