]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Compilation fixes for portability.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 Feb 2007 18:21:14 +0000 (18:21 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Fri, 16 Feb 2007 18:21:14 +0000 (18:21 +0000)
git-svn-id: file:///svn/unbound/trunk@120 be551aaa-1e26-0410-a405-d3ace91eadb9

compat/snprintf.c
configure.ac
services/outside_network.c

index 674cc09c81d3ac089e72b1ef0949fd09c6fbfdec..766c119301a70b9e94ca99a1318c71ec6529cd97 100644 (file)
@@ -136,7 +136,9 @@ int snprintf (va_alist) va_dcl
 #define DP_C_LDOUBLE 3
 
 #define char_to_int(p) (p - '0')
+#ifndef MAX
 #define MAX(p,q) ((p >= q) ? p : q)
+#endif
 
 static void dopr (char *buffer, size_t maxlen, const char *format, va_list args)
 {
index df5c4aece2249f8497dcd4801c6bfd3bc1da012e..161d989baf208fc0cda4e1ce2e2ee605c513cb49 100644 (file)
@@ -480,6 +480,10 @@ AH_BOTTOM([
 #define ftello ftell
 #endif /* HAVE_FSEEKO */
 
+#ifndef RAND_MAX
+#define RAND_MAX       2147483647
+#endif
+
 #ifndef IPV6_MIN_MTU
 #define IPV6_MIN_MTU 1280
 #endif /* IPV6_MIN_MTU */
index 482a7bcd758502fa4aeb1fa4e7a5527574481cd4..a65ab95ecf9243198c36c44735349840732c7a27 100644 (file)
@@ -173,7 +173,8 @@ open_udp_port_range(const char* ifname, struct addrinfo* hints, int porthint)
                &res)) != 0 || !res) {
                log_err("node %s %s getaddrinfo: %s %s",
                        ifname?ifname:"default", (porthint!=-1)?portstr:"eph", 
-                       gai_strerror(r), r==EAI_SYSTEM?strerror(errno):"");
+                       gai_strerror(r), 
+                       r==EAI_SYSTEM?(char*)strerror(errno):"");
                return -1;
        }
        s = create_udp_sock(res);