summaryrefslogtreecommitdiffstats
path: root/rfc1035
diff options
context:
space:
mode:
Diffstat (limited to 'rfc1035')
-rw-r--r--rfc1035/configure.ac26
-rw-r--r--rfc1035/rfc1035str.c18
2 files changed, 18 insertions, 26 deletions
diff --git a/rfc1035/configure.ac b/rfc1035/configure.ac
index 5748f05..ca692c9 100644
--- a/rfc1035/configure.ac
+++ b/rfc1035/configure.ac
@@ -32,7 +32,7 @@ then
fi
dnl Checks for header files.
AC_HEADER_STDC
-AC_CHECK_HEADERS(sys/types.h sys/time.h unistd.h arpa/inet.h netinet/in.h)
+AC_CHECK_HEADERS(sys/types.h sys/time.h unistd.h arpa/inet.h netinet/in.h strings.h)
USENSL=no
saveLIBS="$LIBS"
@@ -89,7 +89,7 @@ AC_ARG_WITH(int32,
#include <sys/types.h>
#endif
],[
- uint32_t i=0;
+ (void)(uint32_t)0;
], [ AC_MSG_RESULT(yes) ; int32="uint32_t"], [
AC_MSG_RESULT(no)
@@ -100,7 +100,7 @@ AC_ARG_WITH(int32,
#include <sys/types.h>
#endif
],[
- u_int32_t i=0;
+ (void)(u_int32_t)0;
], [AC_MSG_RESULT(yes); int32="u_int32_t"],[
AC_MSG_RESULT(no)
@@ -140,7 +140,7 @@ AC_ARG_WITH(int16,
#include <sys/types.h>
#endif
],[
- uint16_t i=0;
+ (void)(uint16_t)0;
], [ AC_MSG_RESULT(yes) ; int16="uint16_t"], [
AC_MSG_RESULT(no)
@@ -151,7 +151,7 @@ AC_ARG_WITH(int16,
#include <sys/types.h>
#endif
],[
- u_int16_t i=0;
+ (void)(u_int16_t)0;
], [AC_MSG_RESULT(yes); int16="u_int16_t"],[
AC_MSG_RESULT(no)
@@ -206,8 +206,6 @@ fi
dnl Checks for library functions.
-AC_CHECK_FUNCS(strcasecmp)
-
dnl Other checks
if test "$GCC" = "yes"
@@ -229,10 +227,10 @@ AC_TRY_COMPILE( [
#include <arpa/inet.h>
], [
-struct in6_addr in6a;
-struct sockaddr_in6 sain6;
-struct sockaddr_storage soas;
-int x=PF_INET6;
+ (void)(sizeof(struct in6_addr)+
+ sizeof(struct sockaddr_in6)+
+ sizeof(struct sockaddr_storage)+
+ PF_INET6);
], rfc1035_cv_hasipv6structs=yes,
rfc1035_cv_hasipv6structs=no )
@@ -346,17 +344,17 @@ then
fi
AC_CACHE_CHECK([for alloca],
- rfc1035_cv_alloca,
+ [rfc1035_cv_alloca],
AC_TRY_COMPILE( [
#include <stdio.h>
#include <stdlib.h>
], [
-char *p=(char *)alloca(10);
+(void)(char *)alloca(10);
], rfc1035_cv_alloca=yes,
- rfc1035_cv_alloca,=no )
+ rfc1035_cv_alloca=no )
)
ipv6=0
diff --git a/rfc1035/rfc1035str.c b/rfc1035/rfc1035str.c
index 4335369..a010250 100644
--- a/rfc1035/rfc1035str.c
+++ b/rfc1035/rfc1035str.c
@@ -52,12 +52,6 @@ static struct { const char *name; int num; } typetab[]={
{"UNIMPLEMENTED", 4},
{"REFUSED", 5}};
-#if HAVE_STRCASECMP
-#define COMPARE(a,b) strcasecmp((a), (b))
-#else
-#define COMPARE(a,b) stricmp((a), (b))
-#endif
-
void rfc1035_type_itostr(int n, void (*func)(const char *, void *), void *arg)
{
unsigned i;
@@ -82,7 +76,7 @@ int rfc1035_type_strtoi(const char *n)
unsigned i;
for (i=0; i<sizeof(typetab)/sizeof(typetab[0]); i++)
- if (COMPARE(typetab[i].name, n) == 0) return (typetab[i].num);
+ if (strcasecmp(typetab[i].name, n) == 0) return (typetab[i].num);
return (-1);
}
@@ -100,7 +94,7 @@ int rfc1035_class_strtoi(const char *n)
unsigned i;
for (i=0; i<sizeof(classtab)/sizeof(classtab[0]); i++)
- if (COMPARE(classtab[i].name, n) == 0) return (classtab[i].num);
+ if (strcasecmp(classtab[i].name, n) == 0) return (classtab[i].num);
return (-1);
}
@@ -118,8 +112,8 @@ int rfc1035_opcode_strtoi(const char *n)
unsigned i;
for (i=0; i<sizeof(opcodetab)/sizeof(opcodetab[0]); i++)
- if (COMPARE(opcodetab[i].name, n) == 0)
- return (opcodetab[i].num);
+ if (strcasecmp(opcodetab[i].name, n) == 0)
+ return (opcodetab[i].num);
return (-1);
}
@@ -137,7 +131,7 @@ int rfc1035_rcode_strtoi(const char *n)
unsigned i;
for (i=0; i<sizeof(rcodetab)/sizeof(rcodetab[0]); i++)
- if (COMPARE(rcodetab[i].name, n) == 0)
- return (rcodetab[i].num);
+ if (strcasecmp(rcodetab[i].name, n) == 0)
+ return (rcodetab[i].num);
return (-1);
}