+2009-05-08 Bruno Haible <bruno@clisp.org>
+
+ * lib/sys_socket.in.h (_SS_PADSIZE): Use a conditional expression
+ instead of 'max'.
+
2009-05-08 Simon Josefsson <simon@josefsson.org>
* m4/sys_socket_h.m4: Test for ws2tcpip.h earlier, needed for
#define _GL_SYS_SOCKET_H
#if !@HAVE_STRUCT_SOCKADDR_STORAGE@
-#include <alignof.h>
+# include <alignof.h>
/* Code taken from glibc sysdeps/unix/sysv/linux/bits/socket.h on
2009-05-08, licensed under LGPLv2.1+, plus portability fixes. */
-#define __ss_aligntype unsigned long int
-#define _SS_SIZE 256
-#define _SS_PADSIZE (_SS_SIZE - (max (sizeof (sa_family_t), \
- alignof (__ss_aligntype)) \
- + sizeof (__ss_aligntype)))
+# define __ss_aligntype unsigned long int
+# define _SS_SIZE 256
+# define _SS_PADSIZE \
+ (_SS_SIZE - ((sizeof (sa_family_t) >= alignof (__ss_aligntype) \
+ ? sizeof (sa_family_t) \
+ : alignof (__ss_aligntype)) \
+ + sizeof (__ss_aligntype)))
struct sockaddr_storage
{