mirror of
https://git.postgresql.org/git/postgresql.git
synced 2025-03-01 19:45:33 +08: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:
parent
55d9cd46f6
commit
de42bc3ac8
@ -73,23 +73,11 @@ AC_DEFUN([PGAC_UNION_SEMUN],
|
||||
])])# PGAC_UNION_SEMUN
|
||||
|
||||
|
||||
# PGAC_STRUCT_SOCKADDR_STORAGE
|
||||
# ----------------------------
|
||||
# If `struct sockaddr_storage' exists, define HAVE_STRUCT_SOCKADDR_STORAGE.
|
||||
# If it is missing then one could define it.
|
||||
AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE],
|
||||
[AC_CHECK_TYPES([struct sockaddr_storage], [], [],
|
||||
[#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
])])# PGAC_STRUCT_SOCKADDR_STORAGE
|
||||
|
||||
# PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS
|
||||
# --------------------------------------
|
||||
# Check the members of `struct sockaddr_storage'. We need to know about
|
||||
# ss_family and ss_len. (Some platforms follow RFC 2553 and call them
|
||||
# __ss_family and __ss_len.) We also check struct sockaddr's sa_len;
|
||||
# if we have to define our own `struct sockaddr_storage', this tells us
|
||||
# whether we need to provide an ss_len field.
|
||||
# __ss_family and __ss_len.) We also check struct sockaddr's sa_len.
|
||||
AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS],
|
||||
[AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family,
|
||||
struct sockaddr_storage.__ss_family,
|
||||
|
13
configure
vendored
13
configure
vendored
@ -15058,19 +15058,6 @@ cat >>confdefs.h <<_ACEOF
|
||||
_ACEOF
|
||||
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
|
||||
#include <sys/socket.h>
|
||||
|
||||
"
|
||||
if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
|
||||
|
||||
cat >>confdefs.h <<_ACEOF
|
||||
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
|
||||
_ACEOF
|
||||
|
||||
|
||||
fi
|
||||
|
||||
ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>
|
||||
|
@ -1618,7 +1618,6 @@ PGAC_C_COMPUTED_GOTO
|
||||
PGAC_STRUCT_TIMEZONE
|
||||
PGAC_UNION_SEMUN
|
||||
AC_CHECK_TYPES(socklen_t, [], [], [#include <sys/socket.h>])
|
||||
PGAC_STRUCT_SOCKADDR_STORAGE
|
||||
PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS
|
||||
PGAC_STRUCT_ADDRINFO
|
||||
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user