From 0488b6e88b52bde4c69df38b40a32095e252ef22 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 27 Apr 2013 08:11:56 -0700 Subject: [PATCH] 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__. --- 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 fd0596674..eb12be04c 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2013-04-27 Paul Eggert + + 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 wctype-h: fix gettext link error on mingw diff --git a/lib/alignof.h b/lib/alignof.h index 15e190d8a..c74658234 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 b473052d1..f57f9b4dd 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 7fa2b9fd2..4cc4e3fbb 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 struct sa_alignof_helper { char __slot1; type __slot2; }; -- 2.11.0