Skip to content

Commit 71b0fe5

Browse files
committed
Workaround for platforms that have getaddrinfo() without AI_NUMERICHOST.
We don't actually need the flag, so just #define it as zero in such cases.
1 parent 2b5f049 commit 71b0fe5

File tree

1 file changed

+10
-2
lines changed

1 file changed

+10
-2
lines changed

src/include/getaddrinfo.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
*
1616
* Copyright (c) 2003, PostgreSQL Global Development Group
1717
*
18-
* $Id: getaddrinfo.h,v 1.10 2003/08/08 21:42:31 momjian Exp $
18+
* $Id: getaddrinfo.h,v 1.11 2003/08/14 18:32:55 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -31,7 +31,6 @@
3131
/* Various macros that ought to be in <netdb.h>, but might not be */
3232

3333
#ifndef EAI_FAIL
34-
3534
#define EAI_BADFLAGS -1
3635
#define EAI_NONAME -2
3736
#define EAI_AGAIN -3
@@ -46,9 +45,18 @@
4645
#ifndef AI_PASSIVE
4746
#define AI_PASSIVE 0x0001
4847
#endif
48+
4949
#ifndef AI_NUMERICHOST
50+
/*
51+
* some platforms don't support AI_NUMERICHOST; define as zero if using
52+
* the system version of getaddrinfo...
53+
*/
54+
#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
55+
#define AI_NUMERICHOST 0
56+
#else
5057
#define AI_NUMERICHOST 0x0004
5158
#endif
59+
#endif
5260

5361
#ifndef NI_NUMERICHOST
5462
#define NI_NUMERICHOST 1

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy