libreplace: replace inet_ntoa() when it is missing
commitedcf2712bcdedabbfdd9ee8b9a18f46126930636
authorMichael Adam <obnox@samba.org>
Tue, 18 Mar 2008 11:16:47 +0000 (18 12:16 +0100)
committerStefan Metzmacher <metze@samba.org>
Tue, 18 Mar 2008 15:44:59 +0000 (18 16:44 +0100)
tree26f43c2d1a91a123293d6146bc2de12ed7041c13
parentf69e51f56f111d9bd5db69e191f45567aacf8c3d
libreplace: replace inet_ntoa() when it is missing

...not only replace it when it is broken.

This moves the defintion of rep_inet_ntoa from replace.c
to inet_ntoa.c and adds configure checks for existence
of inet_ntoa(). Checks are moved to an include file of its own.

NOTE: The original rep_inet_ntoa in replace.c was wrapped
into a "#ifndef WITH_PTHREADS" but the prototype in replace.h
and the define in system/network.h were not. I removed that
ifndef since the inet_ntoa() function is usually not thread safe
anyways, since it returns a pointer to a static buffer.

So whoever calls inet_ntoa() should be aware that it is not
thread safe anyways.

Michael
(cherry picked from commit 974c0c45ad42644348e0b55454715b12158f1028)
source/lib/replace/inet_ntoa.c [new file with mode: 0644]
source/lib/replace/inet_ntoa.m4 [new file with mode: 0644]
source/lib/replace/libreplace.m4
source/lib/replace/replace.c
source/lib/replace/replace.h
source/lib/replace/system/network.h