bug-gnulib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: sys_socket: sockaddr_storage, new module alignof


From: Bruno Haible
Subject: Re: sys_socket: sockaddr_storage, new module alignof
Date: Wed, 13 May 2009 03:22:43 +0200
User-agent: KMail/1.9.9

In this commit:
> 2009-05-08  Bruno Haible  <address@hidden>
> 
>       New module 'alignof'.
>       * lib/alignof.h: New file.
>       * modules/alignof: New file.
>       * lib/malloca.h: Include alignof.h.
>       (sa_alignof): Remove macro.
>       (sa_alignment_*): Use the alignof macro.
>       * modules/malloca (Depends-on): Add alignof.

the special cases for AIX cc,xlc and HP-UX cc are not right in general.
They are only right in the context of malloca.h.

I've reverted the malloca related part of that commit and applied this fix:


2009-05-12  Bruno Haible  <address@hidden>

        Fix alignof macro.
        * lib/alignof.h (alignof): Remove special cases for AIX and HP-UX
        vendor compilers that are always correct.

*** lib/alignof.h.orig  2009-05-13 03:20:03.000000000 +0200
--- lib/alignof.h       2009-05-13 03:18:00.000000000 +0200
***************
*** 26,39 ****
  #elif defined __cplusplus
    template <class type> struct alignof_helper { char __slot1; type __slot2; };
  # define alignof(type) offsetof (alignof_helper<type>, __slot2)
- #elif defined __hpux
-   /* Work around a HP-UX 10.20 cc bug with enums constants defined as offsetof
-      values.  */
- # define 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 alignof(type) (sizeof (type) <= 4 ? 4 : 8)
  #else
  # define alignof(type) offsetof (struct { char __slot1; type __slot2; }, 
__slot2)
  #endif
--- 26,31 ----




reply via email to

[Prev in Thread] Current Thread [Next in Thread]