From 316c126447c50cc4df8dc0cb1276c68d03f7da38 Mon Sep 17 00:00:00 2001 From: Gunter Knauf Date: Tue, 3 Jul 2007 16:00:36 +0000 Subject: [PATCH] few minor changes to make ares compile for NetWare CLIB architecture. --- Makefile.netware | 7 ++++--- ares.h | 2 +- ares_getnameinfo.c | 4 ++++ ares_init.c | 3 +++ 4 files changed, 12 insertions(+), 4 deletions(-) diff --git a/Makefile.netware b/Makefile.netware index d5bfe7c..c8e91c6 100644 --- a/Makefile.netware +++ b/Makefile.netware @@ -281,8 +281,8 @@ config.h: Makefile.netware @echo $(DL)#define PACKAGE_BUGREPORT "a suitable curl mailing list => http://curl.haxx.se/mail/"$(DL) >> $@ ifeq ($(LIBARCH),CLIB) @echo $(DL)#define OS "i586-pc-clib-NetWare"$(DL) >> $@ + @echo $(DL)#define MAXHOSTNAMELEN 256$(DL) >> $@ @echo $(DL)#define NETDB_USE_INTERNET 1$(DL) >> $@ - @echo $(DL)#define HAVE_STRICMP 1$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG1 int$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG2 char *$(DL) >> $@ @echo $(DL)#define RECV_TYPE_ARG3 int$(DL) >> $@ @@ -294,9 +294,10 @@ ifeq ($(LIBARCH),CLIB) @echo $(DL)#define SEND_TYPE_ARG3 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_ARG4 int$(DL) >> $@ @echo $(DL)#define SEND_TYPE_RETV int$(DL) >> $@ - @echo $(DL)#define socklen_t int$(DL) >> $@ @echo $(DL)#define DL_LDAP_FILE "ldapsdk.nlm"$(DL) >> $@ - @echo $(DL)#define MAXHOSTNAMELEN 256$(DL) >> $@ + @echo $(DL)#define socklen_t int$(DL) >> $@ + @echo $(DL)#define strncasecmp strnicmp$(DL) >> $@ + @echo $(DL)#define strcasecmp stricmp$(DL) >> $@ else @echo $(DL)#define OS "i586-pc-libc-NetWare"$(DL) >> $@ @echo $(DL)#define HAVE_DLFCN_H 1$(DL) >> $@ diff --git a/ares.h b/ares.h index 6b94295..04b17ed 100644 --- a/ares.h +++ b/ares.h @@ -20,7 +20,7 @@ #include -#if defined(_AIX) || defined(NETWARE) +#if defined(_AIX) || (defined(NETWARE) && defined(__NOVELL_LIBC__)) /* HP-UX systems version 9, 10 and 11 lack sys/select.h and so does oldish libc5-based Linux systems. Only include it on system that are known to require it! */ diff --git a/ares_getnameinfo.c b/ares_getnameinfo.c index 8d10cfc..2c28ceb 100644 --- a/ares_getnameinfo.c +++ b/ares_getnameinfo.c @@ -295,8 +295,12 @@ static char *lookup_service(unsigned short port, int flags, #endif #else /* Lets just hope the OS uses TLS! */ +#if (defined(NETWARE) && !defined(__NOVELL_LIBC__)) + sep = getservbyport(port, (char*)proto); +#else sep = getservbyport(port, proto); #endif +#endif } if (sep && sep->s_name) /* get service name */ diff --git a/ares_init.c b/ares_init.c index c9faf45..f6018c9 100644 --- a/ares_init.c +++ b/ares_init.c @@ -23,7 +23,10 @@ #include #else +#ifdef HAVE_SYS_PARAM_H #include +#endif + #ifdef HAVE_SYS_TIME_H #include #endif -- 2.7.4