Commit 71b0fe5b authored by Tom Lane's avatar Tom Lane

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.
parent 2b5f049f
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
* *
* Copyright (c) 2003, PostgreSQL Global Development Group * Copyright (c) 2003, PostgreSQL Global Development Group
* *
* $Id: getaddrinfo.h,v 1.10 2003/08/08 21:42:31 momjian Exp $ * $Id: getaddrinfo.h,v 1.11 2003/08/14 18:32:55 tgl Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -31,7 +31,6 @@ ...@@ -31,7 +31,6 @@
/* Various macros that ought to be in <netdb.h>, but might not be */ /* Various macros that ought to be in <netdb.h>, but might not be */
#ifndef EAI_FAIL #ifndef EAI_FAIL
#define EAI_BADFLAGS -1 #define EAI_BADFLAGS -1
#define EAI_NONAME -2 #define EAI_NONAME -2
#define EAI_AGAIN -3 #define EAI_AGAIN -3
...@@ -46,9 +45,18 @@ ...@@ -46,9 +45,18 @@
#ifndef AI_PASSIVE #ifndef AI_PASSIVE
#define AI_PASSIVE 0x0001 #define AI_PASSIVE 0x0001
#endif #endif
#ifndef AI_NUMERICHOST #ifndef AI_NUMERICHOST
/*
* some platforms don't support AI_NUMERICHOST; define as zero if using
* the system version of getaddrinfo...
*/
#if defined(HAVE_STRUCT_ADDRINFO) && defined(HAVE_GETADDRINFO)
#define AI_NUMERICHOST 0
#else
#define AI_NUMERICHOST 0x0004 #define AI_NUMERICHOST 0x0004
#endif #endif
#endif
#ifndef NI_NUMERICHOST #ifndef NI_NUMERICHOST
#define NI_NUMERICHOST 1 #define NI_NUMERICHOST 1
......
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