pgsql: Fix portability issues in new src/port/inet_net_ntop.c file.

Started by Tom Laneover 15 years ago2 messagescomitters
Jump to latest
#1Tom Lane
tgl@sss.pgh.pa.us

Fix portability issues in new src/port/inet_net_ntop.c file.

1. Don't #include postgres.h in a frontend build.

2. Don't assume that the backend's symbol PGSQL_AF_INET6 has anything to do
with the constant that will be used by system library functions (because,
in point of fact, it usually doesn't). Fortunately, PGSQL_AF_INET is equal
to AF_INET, so we can just cater for both sets of values in one case
construct without fear of conflict.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=3840bc0847aa1b635127ff4a55b5257c9ebc79b8

Modified Files
--------------
src/port/inet_net_ntop.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)

#2Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#1)
Re: pgsql: Fix portability issues in new src/port/inet_net_ntop.c file.

Nice. I was just working on this issue myself, and it is the cause of
Peter's problem report. I will post the new output.

---------------------------------------------------------------------------

Tom Lane wrote:

Fix portability issues in new src/port/inet_net_ntop.c file.

1. Don't #include postgres.h in a frontend build.

2. Don't assume that the backend's symbol PGSQL_AF_INET6 has anything to do
with the constant that will be used by system library functions (because,
in point of fact, it usually doesn't). Fortunately, PGSQL_AF_INET is equal
to AF_INET, so we can just cater for both sets of values in one case
construct without fear of conflict.

Branch
------
master

Details
-------
http://git.postgresql.org/gitweb?p=postgresql.git;a=commitdiff;h=3840bc0847aa1b635127ff4a55b5257c9ebc79b8

Modified Files
--------------
src/port/inet_net_ntop.c | 25 ++++++++++++++++++++++++-
1 files changed, 24 insertions(+), 1 deletions(-)

--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +