# HG changeset patch # User Bruno Haible # Date 1241820096 -7200 # Node ID b7f5d7ba465177343bd07defe2785796e015a9b0 # Parent 3ee72ca3f3ade8509b5aa3909102273351ca9e2a Don't use undefined macro 'max'. diff --git a/ChangeLog b/ChangeLog --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2009-05-08 Bruno Haible + + * lib/sys_socket.in.h (_SS_PADSIZE): Use a conditional expression + instead of 'max'. + 2009-05-08 Simon Josefsson * m4/sys_socket_h.m4: Test for ws2tcpip.h earlier, needed for diff --git a/lib/sys_socket.in.h b/lib/sys_socket.in.h --- a/lib/sys_socket.in.h +++ b/lib/sys_socket.in.h @@ -44,14 +44,16 @@ #define _GL_SYS_SOCKET_H #if !@HAVE_STRUCT_SOCKADDR_STORAGE@ -#include +# include /* 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 {