comparison lib/malloca.h @ 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 e542fd46ad6f
children
comparison
equal deleted inserted replaced
17379:c357d97f690f 17380:2278c530e565
90 90
91 91
92 /* ------------------- Auxiliary, non-public definitions ------------------- */ 92 /* ------------------- Auxiliary, non-public definitions ------------------- */
93 93
94 /* Determine the alignment of a type at compile time. */ 94 /* Determine the alignment of a type at compile time. */
95 #if defined __GNUC__ 95 #if defined __GNUC__ || defined __IBM__ALIGNOF__
96 # define sa_alignof __alignof__ 96 # define sa_alignof __alignof__
97 #elif defined __cplusplus 97 #elif defined __cplusplus
98 template <class type> struct sa_alignof_helper { char __slot1; type __slot2; }; 98 template <class type> struct sa_alignof_helper { char __slot1; type __slot2; };
99 # define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2) 99 # define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2)
100 #elif defined __hpux 100 #elif defined __hpux