Merge from GNU gettext.
authorBruno Haible <bruno@clisp.org>
Sat, 22 Jul 2006 13:56:32 +0000 (13:56 +0000)
committerBruno Haible <bruno@clisp.org>
Sat, 22 Jul 2006 13:56:32 +0000 (13:56 +0000)
lib/ChangeLog
lib/allocsa.h

index ad96677..84e5b41 100644 (file)
@@ -1,3 +1,12 @@
+2005-02-12  Bruno Haible  <bruno@clisp.org>
+
+       * allocsa.h: Add extern "C" for C++.
+
+2005-02-10  Bruno Haible  <bruno@clisp.org>
+
+       * allocsa.h (sa_alignof): Define differently with AIX xlc, to avoid
+       a bug of this compiler on AIX 3.2.5 dealing with enums.
+
 2006-07-22  Bruno Haible  <bruno@clisp.org>
 
        * gettext.h: Update to GNU gettext-0.15.
index cb6893a..36379aa 100644 (file)
@@ -1,5 +1,5 @@
 /* Safe automatic memory allocation.
-   Copyright (C) 2003-2004 Free Software Foundation, Inc.
+   Copyright (C) 2003-2005 Free Software Foundation, Inc.
    Written by Bruno Haible <bruno@clisp.org>, 2003.
 
    This program is free software; you can redistribute it and/or modify
 #include <stddef.h>
 #include <stdlib.h>
 
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
 /* safe_alloca(N) is equivalent to alloca(N) when it is safe to call
    alloca(N); otherwise it returns NULL.  It either returns N bytes of
    memory allocated on the stack, that lasts until the function returns,
@@ -69,6 +75,11 @@ extern void freesa (void *p);
    If this would be useful in your application. please speak up.  */
 
 
+#ifdef __cplusplus
+}
+#endif
+
+
 /* ------------------- Auxiliary, non-public definitions ------------------- */
 
 /* Determine the alignment of a type at compile time.  */
@@ -81,6 +92,10 @@ extern void freesa (void *p);
   /* 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)
+#elif defined _AIX
+  /* Work around an AIX 3.2.5 xlc bug with enums constants defined as offsetof
+     values.  */
+# define sa_alignof(type) 4
 #else
 # define sa_alignof(type) offsetof (struct { char __slot1; type __slot2; }, __slot2)
 #endif