]> git.ipfire.org Git - thirdparty/gettext.git/commitdiff
Work around a bug of HP-UX cc.
authorBruno Haible <bruno@clisp.org>
Fri, 6 Feb 2004 21:09:50 +0000 (21:09 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 23 Jun 2009 10:11:47 +0000 (12:11 +0200)
gettext-tools/lib/ChangeLog
gettext-tools/lib/allocsa.h

index d2ba37a3ce0a2fdb5a6ed54376d707b702d32961..9ca13b40231ea4bf095ca9e59f0eee5daac7acd7 100644 (file)
@@ -1,3 +1,9 @@
+2004-02-06  Bruno Haible  <bruno@clisp.org>
+
+       * 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 <chris.seip@hp.com>.
+
 2004-02-03  Bruno Haible  <bruno@clisp.org>
 
        * pipe.c: New file, synthesis of pipe-in.c, pipe-out.c, pipe-bidi.c.
index 9d33bdc6237cb59552e05cca075ea52cab4cd1a4..b5fdac56f6a16501921972450ee771ab3718ac98 100644 (file)
@@ -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