svn commit: samba r25724 - in branches/SAMBA_4_0/source/lib/replace: . system

metze at samba.org metze at samba.org
Thu Oct 25 06:53:38 GMT 2007


Author: metze
Date: 2007-10-25 06:53:38 +0000 (Thu, 25 Oct 2007)
New Revision: 25724

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=25724

Log:
- include getaddrinfo.h after we have defined struct addrinfo
- use rep_ instead of pg_ as prefix in getaddrinfo.[ch]
- define HAVE_<name> macros when we replace functions

metze
Modified:
   branches/SAMBA_4_0/source/lib/replace/getaddrinfo.c
   branches/SAMBA_4_0/source/lib/replace/getaddrinfo.h
   branches/SAMBA_4_0/source/lib/replace/system/network.h


Changeset:
Modified: branches/SAMBA_4_0/source/lib/replace/getaddrinfo.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/getaddrinfo.c	2007-10-25 05:04:55 UTC (rev 25723)
+++ branches/SAMBA_4_0/source/lib/replace/getaddrinfo.c	2007-10-25 06:53:38 UTC (rev 25724)
@@ -253,7 +253,7 @@
  *	Bugs:	- servname can only be a number, not text.
  */
 
-int getaddrinfo(const char *node,
+int rep_getaddrinfo(const char *node,
 		const char *service,
 		const struct addrinfo * hintp,
 		struct addrinfo ** res)
@@ -315,7 +315,7 @@
 }
 
 
-void freeaddrinfo(struct addrinfo *res)
+void rep_freeaddrinfo(struct addrinfo *res)
 {
 	struct addrinfo *next = NULL;
 
@@ -332,7 +332,7 @@
 }
 
 
-const char *gai_strerror(int errcode)
+const char *rep_gai_strerror(int errcode)
 {
 #ifdef HAVE_HSTRERROR
 	int			hcode;
@@ -468,7 +468,7 @@
  *
  * Bugs:	- No IPv6 support.
  */
-int getnameinfo(const struct sockaddr *sa, socklen_t salen,
+int rep_getnameinfo(const struct sockaddr *sa, socklen_t salen,
 			char *node, size_t nodelen,
 			char *service, size_t servicelen, int flags)
 {

Modified: branches/SAMBA_4_0/source/lib/replace/getaddrinfo.h
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/getaddrinfo.h	2007-10-25 05:04:55 UTC (rev 25723)
+++ branches/SAMBA_4_0/source/lib/replace/getaddrinfo.h	2007-10-25 06:53:38 UTC (rev 25724)
@@ -37,6 +37,9 @@
  * struct definitions needed to call it.  To avoid conflict with the libbind
  * definition in such cases, we rename our routines to pg_xxx() via macros.
  *
+
+in lib/replace we use rep_xxx()
+
  * This code will also work on platforms where struct addrinfo is defined
  * in the system headers but no getaddrinfo() can be located.
  *
@@ -53,28 +56,32 @@
 #ifdef getaddrinfo
 #undef getaddrinfo
 #endif
-#define getaddrinfo pg_getaddrinfo
+#define getaddrinfo rep_getaddrinfo
+#define HAVE_GETADDRINFO
 
 #ifdef freeaddrinfo
 #undef freeaddrinfo
 #endif
-#define freeaddrinfo pg_freeaddrinfo
+#define freeaddrinfo rep_freeaddrinfo
+#define HAVE_FREEADDRINFO
 
 #ifdef gai_strerror
 #undef gai_strerror
 #endif
-#define gai_strerror pg_gai_strerror
+#define gai_strerror rep_gai_strerror
+#define HAVE_GAI_STRERROR
 
 #ifdef getnameinfo
 #undef getnameinfo
 #endif
-#define getnameinfo pg_getnameinfo
+#define getnameinfo rep_getnameinfo
+#define HAVE_GETNAMEINFO
 
-extern int getaddrinfo(const char *node, const char *service,
+extern int rep_getaddrinfo(const char *node, const char *service,
 			const struct addrinfo * hints, struct addrinfo ** res);
-extern void freeaddrinfo(struct addrinfo * res);
-extern const char *gai_strerror(int errcode);
-extern int getnameinfo(const struct sockaddr * sa, socklen_t salen,
+extern void rep_freeaddrinfo(struct addrinfo * res);
+extern const char *rep_gai_strerror(int errcode);
+extern int rep_getnameinfo(const struct sockaddr * sa, socklen_t salen,
 			char *node, size_t nodelen,
 			char *service, size_t servicelen, int flags);
 #endif   /* HAVE_GETADDRINFO */

Modified: branches/SAMBA_4_0/source/lib/replace/system/network.h
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/system/network.h	2007-10-25 05:04:55 UTC (rev 25723)
+++ branches/SAMBA_4_0/source/lib/replace/system/network.h	2007-10-25 06:53:38 UTC (rev 25724)
@@ -93,10 +93,6 @@
 const char *rep_inet_ntop(int af, const void *src, char *dst, socklen_t size);
 #endif
 
-#if !defined(HAVE_GETADDRINFO)
-#include "getaddrinfo.h"
-#endif
-
 /*
  * Some systems have getaddrinfo but not the
  * defines needed to use it.
@@ -212,6 +208,7 @@
 #endif
 
 #ifndef HAVE_STRUCT_SOCKADDR_STORAGE
+#define HAVE_STRUCT_SOCKADDR_STORAGE
 #ifdef HAVE_STRUCT_SOCKADDR_IN6
 #define sockaddr_storage sockaddr_in6
 #define ss_family sin6_family
@@ -235,6 +232,10 @@
 };
 #endif   /* HAVE_STRUCT_ADDRINFO */
 
+#if !defined(HAVE_GETADDRINFO)
+#include "getaddrinfo.h"
+#endif
+
 #ifdef SOCKET_WRAPPER
 #ifndef SOCKET_WRAPPER_NOT_REPLACE
 #define SOCKET_WRAPPER_REPLACE



More information about the samba-cvs mailing list