Commit a2902a6f by Dmitriy Anisimkov Committed by Pierre-Marie de Rodat

[Ada] GNAT.Sockets: refactor Has_Sockaddr_Len

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
parent d8f8b166
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
......
......@@ -185,6 +185,7 @@
#include <limits.h>
#include <errno.h>
#include <stddef.h>
#if defined (__vxworks) && ! defined (__RTP__)
#include <sys/times.h>
......@@ -252,12 +253,7 @@
# 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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment