Skip to content

Commit de42bc3

Browse files
committed
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
1 parent 55d9cd4 commit de42bc3

File tree

6 files changed

+1
-54
lines changed

6 files changed

+1
-54
lines changed

config/c-library.m4

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -73,23 +73,11 @@ AC_DEFUN([PGAC_UNION_SEMUN],
7373
])])# PGAC_UNION_SEMUN
7474

7575

76-
# PGAC_STRUCT_SOCKADDR_STORAGE
77-
# ----------------------------
78-
# If `struct sockaddr_storage' exists, define HAVE_STRUCT_SOCKADDR_STORAGE.
79-
# If it is missing then one could define it.
80-
AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE],
81-
[AC_CHECK_TYPES([struct sockaddr_storage], [], [],
82-
[#include <sys/types.h>
83-
#include <sys/socket.h>
84-
])])# PGAC_STRUCT_SOCKADDR_STORAGE
85-
8676
# PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS
8777
# --------------------------------------
8878
# Check the members of `struct sockaddr_storage'. We need to know about
8979
# ss_family and ss_len. (Some platforms follow RFC 2553 and call them
90-
# __ss_family and __ss_len.) We also check struct sockaddr's sa_len;
91-
# if we have to define our own `struct sockaddr_storage', this tells us
92-
# whether we need to provide an ss_len field.
80+
# __ss_family and __ss_len.) We also check struct sockaddr's sa_len.
9381
AC_DEFUN([PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS],
9482
[AC_CHECK_MEMBERS([struct sockaddr_storage.ss_family,
9583
struct sockaddr_storage.__ss_family,

configure

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -15058,19 +15058,6 @@ cat >>confdefs.h <<_ACEOF
1505815058
_ACEOF
1505915059

1506015060

15061-
fi
15062-
15063-
ac_fn_c_check_type "$LINENO" "struct sockaddr_storage" "ac_cv_type_struct_sockaddr_storage" "#include <sys/types.h>
15064-
#include <sys/socket.h>
15065-
15066-
"
15067-
if test "x$ac_cv_type_struct_sockaddr_storage" = xyes; then :
15068-
15069-
cat >>confdefs.h <<_ACEOF
15070-
#define HAVE_STRUCT_SOCKADDR_STORAGE 1
15071-
_ACEOF
15072-
15073-
1507415061
fi
1507515062

1507615063
ac_fn_c_check_member "$LINENO" "struct sockaddr_storage" "ss_family" "ac_cv_member_struct_sockaddr_storage_ss_family" "#include <sys/types.h>

configure.ac

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1618,7 +1618,6 @@ PGAC_C_COMPUTED_GOTO
16181618
PGAC_STRUCT_TIMEZONE
16191619
PGAC_UNION_SEMUN
16201620
AC_CHECK_TYPES(socklen_t, [], [], [#include <sys/socket.h>])
1621-
PGAC_STRUCT_SOCKADDR_STORAGE
16221621
PGAC_STRUCT_SOCKADDR_STORAGE_MEMBERS
16231622
PGAC_STRUCT_ADDRINFO
16241623

src/include/libpq/pqcomm.h

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#include <netdb.h>
2222
#include <netinet/in.h>
2323

24-
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE
25-
2624
#ifndef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
2725
#ifdef HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY
2826
#define ss_family __ss_family
@@ -35,27 +33,6 @@
3533
#define ss_len __ss_len
3634
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
3735
#endif
38-
#else /* !HAVE_STRUCT_SOCKADDR_STORAGE */
39-
40-
/* Define a struct sockaddr_storage if we don't have one. */
41-
42-
struct sockaddr_storage
43-
{
44-
union
45-
{
46-
struct sockaddr sa; /* get the system-dependent fields */
47-
int64 ss_align; /* ensures struct is properly aligned */
48-
char ss_pad[128]; /* ensures struct has desired size */
49-
} ss_stuff;
50-
};
51-
52-
#define ss_family ss_stuff.sa.sa_family
53-
/* It should have an ss_len field if sockaddr has sa_len. */
54-
#ifdef HAVE_STRUCT_SOCKADDR_SA_LEN
55-
#define ss_len ss_stuff.sa.sa_len
56-
#define HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN 1
57-
#endif
58-
#endif /* HAVE_STRUCT_SOCKADDR_STORAGE */
5936

6037
typedef struct
6138
{

src/include/pg_config.h.in

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -460,9 +460,6 @@
460460
/* Define to 1 if `sa_len' is a member of `struct sockaddr'. */
461461
#undef HAVE_STRUCT_SOCKADDR_SA_LEN
462462

463-
/* Define to 1 if the system has the type `struct sockaddr_storage'. */
464-
#undef HAVE_STRUCT_SOCKADDR_STORAGE
465-
466463
/* Define to 1 if `ss_family' is a member of `struct sockaddr_storage'. */
467464
#undef HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY
468465

src/tools/msvc/Solution.pm

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ sub GenerateFiles
349349
HAVE_STRUCT_CMSGCRED => undef,
350350
HAVE_STRUCT_OPTION => undef,
351351
HAVE_STRUCT_SOCKADDR_SA_LEN => undef,
352-
HAVE_STRUCT_SOCKADDR_STORAGE => 1,
353352
HAVE_STRUCT_SOCKADDR_STORAGE_SS_FAMILY => 1,
354353
HAVE_STRUCT_SOCKADDR_STORAGE_SS_LEN => undef,
355354
HAVE_STRUCT_SOCKADDR_STORAGE___SS_FAMILY => undef,

0 commit comments

Comments
 (0)