From: Bruno Haible Date: Fri, 6 Feb 2004 21:09:50 +0000 (+0000) Subject: Work around a bug of HP-UX cc. X-Git-Tag: v0.14.2~299 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8a9be328542a0a4131e53c6f5510eae34d09ed62;p=thirdparty%2Fgettext.git Work around a bug of HP-UX cc. --- diff --git a/gettext-tools/lib/ChangeLog b/gettext-tools/lib/ChangeLog index d2ba37a3c..9ca13b402 100644 --- a/gettext-tools/lib/ChangeLog +++ b/gettext-tools/lib/ChangeLog @@ -1,3 +1,9 @@ +2004-02-06 Bruno Haible + + * allocsa.h (sa_alignof): Define differently with HP-UX cc, to avoid + a bug of this cc on HP-UX 10.20 dealing with enums. + Reported by Christopher Seip . + 2004-02-03 Bruno Haible * pipe.c: New file, synthesis of pipe-in.c, pipe-out.c, pipe-bidi.c. diff --git a/gettext-tools/lib/allocsa.h b/gettext-tools/lib/allocsa.h index 9d33bdc62..b5fdac56f 100644 --- a/gettext-tools/lib/allocsa.h +++ b/gettext-tools/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 @@ -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