X-Git-Url: http://erislabs.net/gitweb/?a=blobdiff_plain;f=lib%2Fallocsa.h;h=cb6893ad14139bcd0199ce6f46a73c7c3a501f7e;hb=5fa5d3d767b29cf1d757609afbb56459b09743fa;hp=9d33bdc6237cb59552e05cca075ea52cab4cd1a4;hpb=89b8139ba25466f02fc5d25e9b9af3af6b7370d7;p=gnulib.git diff --git a/lib/allocsa.h b/lib/allocsa.h index 9d33bdc62..cb6893ad1 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 , 2003. This program is free software; you can redistribute it and/or modify @@ -14,7 +14,7 @@ You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ #ifndef _ALLOCSA_H #define _ALLOCSA_H @@ -77,6 +77,10 @@ extern void freesa (void *p); #elif defined __cplusplus template struct sa_alignof_helper { char __slot1; type __slot2; }; # define sa_alignof(type) offsetof (sa_alignof_helper, __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,