From: Paul Eggert Date: Tue, 4 Nov 2014 00:34:52 +0000 (-0800) Subject: obstack: port to platforms that #define __alignof__ X-Git-Tag: v1.0~7269 X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=ec799b2df4aa6fec632e4f26002674eab8a09e18;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index 6728893e43..274b7948ee 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 ba7dff30ea..d763c5786b 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