changeset 17380:2278c530e565

alignof, intprops, malloca: port better to IBM's C compiler * lib/alignof.h (alignof_type) [__IBM_ALIGNOF__]: Use __alignof__. * lib/intprops.h (_GL_HAVE___TYPEOF__) [__IBM_TYPEOF__]: Now 1. * lib/malloca.h (sa_alignof): [__IBM_ALIGNOF__]: Use __alignof__.
author Paul Eggert <eggert@cs.ucla.edu>
date Sat, 27 Apr 2013 08:11:56 -0700
parents c357d97f690f
children 915d2ad64b47
files ChangeLog lib/alignof.h lib/intprops.h lib/malloca.h
diffstat 4 files changed, 10 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-04-27  Paul Eggert  <eggert@cs.ucla.edu>
+
+	alignof, intprops, malloca: port better to IBM's C compiler
+	* lib/alignof.h (alignof_type) [__IBM_ALIGNOF__]: Use __alignof__.
+	* lib/intprops.h (_GL_HAVE___TYPEOF__) [__IBM_TYPEOF__]: Now 1.
+	* lib/malloca.h (sa_alignof): [__IBM_ALIGNOF__]: Use __alignof__.
+
 2013-04-25  Daiki Ueno  <ueno@gnu.org>
 
 	wctype-h: fix gettext link error on mingw
--- a/lib/alignof.h
+++ b/lib/alignof.h
@@ -41,7 +41,7 @@
    - when -malign-double is specified:      alignof_slot(double) = 8.
    Note: The result cannot be used as a value for an 'enum' constant,
    due to bugs in HP-UX 10.20 cc and AIX 3.2.5 xlc.  */
-#if defined __GNUC__
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
 # define alignof_type __alignof__
 #else
 # define alignof_type alignof_slot
--- a/lib/intprops.h
+++ b/lib/intprops.h
@@ -89,7 +89,7 @@
 
 /* Return 1 if the __typeof__ keyword works.  This could be done by
    'configure', but for now it's easier to do it by hand.  */
-#if 2 <= __GNUC__ || 0x5110 <= __SUNPRO_C
+#if 2 <= __GNUC__ || defined __IBM__TYPEOF__ || 0x5110 <= __SUNPRO_C
 # define _GL_HAVE___TYPEOF__ 1
 #else
 # define _GL_HAVE___TYPEOF__ 0
--- a/lib/malloca.h
+++ b/lib/malloca.h
@@ -92,7 +92,7 @@
 /* ------------------- Auxiliary, non-public definitions ------------------- */
 
 /* Determine the alignment of a type at compile time.  */
-#if defined __GNUC__
+#if defined __GNUC__ || defined __IBM__ALIGNOF__
 # define sa_alignof __alignof__
 #elif defined __cplusplus
   template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };