]> Savannah Git Hosting - gnulib.git/commitdiff
alignof, intprops, malloca: port better to IBM's C compiler
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Apr 2013 15:11:56 +0000 (08:11 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 27 Apr 2013 15:12:24 +0000 (08:12 -0700)
* 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__.

ChangeLog
lib/alignof.h
lib/intprops.h
lib/malloca.h

index fd0596674da8ef051cb7c4c9b3b509636bbcad8d..eb12be04c47e038de5f20733ca0e85c9f89e2ea4 100644 (file)
--- 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
index 15e190d8a299fd61986f2140cea5848f06d85c93..c74658234e58321bad66d713617d1af1cb4405cc 100644 (file)
@@ -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
index b473052d11483098bd69bbce725cc1b582d5df35..f57f9b4ddab25cf228f3c736e05cda6a6690c86d 100644 (file)
@@ -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
index 7fa2b9fd255708249229e213132af53215be49a8..4cc4e3fbb4778139f8f2238c59f64b5e10e9fab9 100644 (file)
@@ -92,7 +92,7 @@ extern void * nmalloca (size_t n, size_t s);
 /* ------------------- 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; };