Use a field offset computation trick to avoid maintaining a list of
platforms.
2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
gcc/ada/
* gsocket.h (Has_Sockaddr_Len): Use the offset of sin_family offset in
the sockaddr_in structure to determine the existence of length field
before the sin_family.
From-SVN: r272877
+2019-07-01 Dmitriy Anisimkov <anisimko@adacore.com>
+
+ * gsocket.h (Has_Sockaddr_Len): Use the offset of sin_family offset in
+ the sockaddr_in structure to determine the existence of length field
+ before the sin_family.
+
2019-07-01 Ed Schonberg <schonberg@adacore.com>
* sem_prag.adb (Analyze_Pragma, case Weak_External): Pragma only
#include <limits.h>
#include <errno.h>
+#include <stddef.h>
#if defined (__vxworks) && ! defined (__RTP__)
#include <sys/times.h>
# endif
#endif
-#if defined (__FreeBSD__) || defined (__vxworks) || defined(__rtems__) \
- || defined (__DragonFly__) || defined (__NetBSD__) || defined (__OpenBSD__)
-# define Has_Sockaddr_Len 1
-#else
-# define Has_Sockaddr_Len 0
-#endif
+# define Has_Sockaddr_Len (offsetof(struct sockaddr_in, sin_family) != 0)
#if !(defined (_WIN32) || defined (__hpux__) || defined (VMS))
# define HAVE_INET_PTON