summaryrefslogtreecommitdiff
path: root/gl/sys_socket.in.h
diff options
context:
space:
mode:
Diffstat (limited to 'gl/sys_socket.in.h')
-rw-r--r--gl/sys_socket.in.h14
1 files changed, 8 insertions, 6 deletions
diff --git a/gl/sys_socket.in.h b/gl/sys_socket.in.h
index 87eed880ce..dadd56ac58 100644
--- a/gl/sys_socket.in.h
+++ b/gl/sys_socket.in.h
@@ -44,14 +44,16 @@
#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
{