Alexandre Julliard : dnsapi: Fix compile without the resolv library.

Alexandre Julliard julliard at winehq.org
Tue Aug 26 07:06:33 CDT 2008


Module: wine
Branch: master
Commit: 348b3b3af030712d6a939c611d8b2fe671153d27
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=348b3b3af030712d6a939c611d8b2fe671153d27

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Aug 25 16:14:51 2008 +0200

dnsapi: Fix compile without the resolv library.

---

 dlls/dnsapi/dnsapi.h  |    5 +++++
 dlls/dnsapi/ns_name.c |    4 ++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/dlls/dnsapi/dnsapi.h b/dlls/dnsapi/dnsapi.h
index e617012..aa15174 100644
--- a/dlls/dnsapi/dnsapi.h
+++ b/dlls/dnsapi/dnsapi.h
@@ -18,6 +18,9 @@
  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
  */
 
+#ifndef __WINE_CONFIG_H
+# error You must include config.h to use this header
+#endif
 
 static inline void *heap_alloc( SIZE_T size )
 {
@@ -140,7 +143,9 @@ static inline LPSTR dns_strdup_ua( const char *src )
 
 const char *dns_type_to_str( unsigned short );
 
+#ifdef HAVE_RESOLV
 int dns_ns_initparse( const u_char *, int, ns_msg * );
 int dns_ns_parserr( ns_msg *, ns_sect, int, ns_rr * );
 int dns_ns_name_skip( const u_char **, const u_char * );
 int dns_ns_name_uncompress( const u_char *, const u_char *, const u_char *, char *, size_t );
+#endif
diff --git a/dlls/dnsapi/ns_name.c b/dlls/dnsapi/ns_name.c
index a108c56..4bb3e4a 100644
--- a/dlls/dnsapi/ns_name.c
+++ b/dlls/dnsapi/ns_name.c
@@ -17,6 +17,8 @@
 
 #include "config.h"
 
+#ifdef HAVE_RESOLV
+
 #include <sys/types.h>
 
 #ifdef HAVE_NETINET_IN_H
@@ -441,3 +443,5 @@ static int
 printable(int ch) {
 	return (ch > 0x20 && ch < 0x7f);
 }
+
+#endif  /* HAVE_RESOLV */




More information about the wine-cvs mailing list