mirror of
https://github.com/postgres/postgres.git
synced 2025-10-21 02:52:47 +03:00
Remove configure probe for struct sockaddr_storage.
<sys/socket.h> provides sockaddr_storage in SUSv3 and all targeted Unix systems have it. Windows has it too. Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us> Discussion: https://postgr.es/m/CA%2BhUKG%2BL_3brvh%3D8e0BW_VfX9h7MtwgN%3DnFHP5o7X2oZucY9dg%40mail.gmail.com
This commit is contained in:
@@ -21,8 +21,6 @@
|
||||
#include <netdb.h>
|
||||
#include <netinet/in.h>
|
||||
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
|
||||
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
|
||||
#define ss_family __ss_family
|
||||
@@ -35,27 +33,6 @@
|
||||
#define ss_len __ss_len
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
|
||||
#endif
|
||||
#else /* !HAVE_STRUCT_SOCKADDR_STORAGE */
|
||||
|
||||
/* Define a struct sockaddr_storage if we don't have one. */
|
||||
|
||||
struct sockaddr_storage
|
||||
{
|
||||
union
|
||||
{
|
||||
struct sockaddr sa; /* get the system-dependent fields */
|
||||
int64 ss_align; /* ensures struct is properly aligned */
|
||||
char ss_pad[128]; /* ensures struct has desired size */
|
||||
} ss_stuff;
|
||||
};
|
||||
|
||||
#define ss_family ss_stuff.sa.sa_family
|
||||
/* It should have an ss_len field if sockaddr has sa_len. */
|
||||
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||
#define ss_len ss_stuff.sa.sa_len
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
|
||||
#endif
|
||||
#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */
|
||||
|
||||
typedef struct
|
||||
{
|
||||
|
@@ -460,9 +460,6 @@
|
||||
/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */
|
||||
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
|
||||
|
||||
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
|
||||
#undef HAVE_STRUCT_SOCKADDR_STORAGE
|
||||
|
||||
/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
|
||||
#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
|
||||
|
||||
|
@@ -349,7 +349,6 @@ sub GenerateFiles
|
||||
HAVE_STRUCT_CMSGCRED => undef,
|
||||
HAVE_STRUCT_OPTION => undef,
|
||||
HAVE_STRUCT_SOCKADDR_SA_LEN => undef,
|
||||
HAVE_STRUCT_SOCKADDR_STORAGE => 1,
|
||||
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY => 1,
|
||||
HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN => undef,
|
||||
HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY => undef,
|
||||
|
Reference in New Issue
Block a user