1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-19 13:42:17 +03:00

Avoid conflicts with library versions of inet_net_ntop() and friends.

Prefix inet_net_ntop and sibling routines with "pg_" to ensure that
they aren't mistaken for C-library functions.  This fixes warnings
from cpluspluscheck on some platforms, and should help reduce reader
confusion everywhere, since our functions aren't exactly interchangeable
with the library versions (they may have different ideas about address
family codes).

This shouldn't be fixing any actual bugs, unless somebody's linker
is misbehaving, so no need to back-patch.

Discussion: https://postgr.es/m/20518.1559494394@sss.pgh.pa.us
This commit is contained in:
Tom Lane
2019-08-18 19:27:23 -04:00
parent 232720be9b
commit 927f34ce8a
8 changed files with 39 additions and 38 deletions

View File

@@ -44,7 +44,7 @@ static char *inet_cidr_ntop_ipv6(const u_char *src, int bits,
/*
* char *
* inet_cidr_ntop(af, src, bits, dst, size)
* pg_inet_cidr_ntop(af, src, bits, dst, size)
* convert network number from network to presentation format.
* generates CIDR style result always.
* return:
@@ -53,7 +53,7 @@ static char *inet_cidr_ntop_ipv6(const u_char *src, int bits,
* Paul Vixie (ISC), July 1996
*/
char *
inet_cidr_ntop(int af, const void *src, int bits, char *dst, size_t size)
pg_inet_cidr_ntop(int af, const void *src, int bits, char *dst, size_t size)
{
switch (af)
{