bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] alignof, intprops, malloca: port better to IBM's C compiler


From: Paul Eggert
Subject: [PATCH] alignof, intprops, malloca: port better to IBM's C compiler
Date: Sat, 27 Apr 2013 08:14:00 -0700
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130404 Thunderbird/17.0.5

* 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      | 7 +++++++
 lib/alignof.h  | 2 +-
 lib/intprops.h | 2 +-
 lib/malloca.h  | 2 +-
 4 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index fd05966..eb12be0 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-04-27  Paul Eggert  <address@hidden>
+
+       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  <address@hidden>
 
        wctype-h: fix gettext link error on mingw
diff --git a/lib/alignof.h b/lib/alignof.h
index 15e190d..c746582 100644
--- 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
diff --git a/lib/intprops.h b/lib/intprops.h
index b473052..f57f9b4 100644
--- 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
diff --git a/lib/malloca.h b/lib/malloca.h
index 7fa2b9f..4cc4e3f 100644
--- a/lib/malloca.h
+++ b/lib/malloca.h
@@ -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; 
};
-- 
1.7.11.7




reply via email to

[Prev in Thread] Current Thread [Next in Thread]