diff lib/obstack.c @ 17789:47c2be5d17f0

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.
author Paul Eggert <eggert@cs.ucla.edu>
date Mon, 03 Nov 2014 16:34:52 -0800
parents f6c039e09a3b
children 7497a1d1d497
line wrap: on
line diff
--- 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 <alignof.h>
 #  define __alignof__(type) alignof_type (type)
 # endif