]> Savannah Git Hosting - gnulib.git/commitdiff
obstack: port to platforms that #define __alignof__
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 4 Nov 2014 00:34:52 +0000 (16:34 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 4 Nov 2014 08:33:35 +0000 (00:33 -0800)
* lib/obstack.c: Include <alignof.h> 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
lib/obstack.c

index 6728893e438d07758b325ae746eb03c11b97dbbc..274b7948ee29ca40188f535788552dbdf40ba5dd 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2014-11-03  Paul Eggert  <eggert@cs.ucla.edu>
+
+       obstack: port to platforms that #define __alignof__
+       * lib/obstack.c: Include <alignof.h> 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  <P@draigBrady.com>
 
        linkat: don't unconditionally replace on GNU/Linux
index ba7dff30eacc6c4dbc4772a71e71a28c900820ea..d763c5786b31061f4b2435349d8ba422ddfd07ad 100644 (file)
 #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 <alignof.h>
 #  define __alignof__(type) alignof_type (type)
 # endif