diff options
author | Paul Eggert <eggert@cs.ucla.edu> | 2004-11-11 05:02:14 +0000 |
---|---|---|
committer | Paul Eggert <eggert@cs.ucla.edu> | 2004-11-11 05:02:14 +0000 |
commit | d2b4386d2918d43e48e4ea42fcae314af346edd2 (patch) | |
tree | 623f89bf864eb7f3ff11eeb93be5744f8862dee8 /lib/allocsa.h | |
parent | f0dd13bca8a0222f5ffc65a547563e9dc8dfa6ba (diff) | |
download | coreutils-d2b4386d2918d43e48e4ea42fcae314af346edd2.tar.xz |
Sync from gnulib.
Diffstat (limited to 'lib/allocsa.h')
-rw-r--r-- | lib/allocsa.h | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/allocsa.h b/lib/allocsa.h index 4cd820569..b5fdac56f 100644 --- a/lib/allocsa.h +++ b/lib/allocsa.h @@ -1,5 +1,5 @@ /* Safe automatic memory allocation. - Copyright (C) 2003 Free Software Foundation, Inc. + Copyright (C) 2003-2004 Free Software Foundation, Inc. Written by Bruno Haible <bruno@clisp.org>, 2003. This program is free software; you can redistribute it and/or modify @@ -77,6 +77,10 @@ extern void freesa (void *p); #elif defined __cplusplus template <class type> struct sa_alignof_helper { char __slot1; type __slot2; }; # define sa_alignof(type) offsetof (sa_alignof_helper<type>, __slot2) +#elif defined __hpux + /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof + values. */ +# define sa_alignof(type) (sizeof (type) <= 4 ? 4 : 8) #else # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2) #endif @@ -90,14 +94,14 @@ enum #ifdef HAVE_LONG_LONG sa_alignment_longlong = sa_alignof (long long), #endif -#ifdef HAVE_LONG_DOUBLE +#ifdef HAVE_LONG_DOUBLE sa_alignment_longdouble = sa_alignof (long double), #endif sa_alignment_max = ((sa_alignment_long - 1) | (sa_alignment_double - 1) #ifdef HAVE_LONG_LONG | (sa_alignment_longlong - 1) #endif -#ifdef HAVE_LONG_DOUBLE +#ifdef HAVE_LONG_DOUBLE | (sa_alignment_longdouble - 1) #endif ) + 1, |