nightmaremail

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit f1196059ec92ee2b50e6729bfd0fdf06365d18f0
parent 71580a477d784996287da2e6590070b7ecbdb47f
Author: Alan Post <adp@prgmr.com>
Date:   Thu, 11 Jul 2019 19:29:18 -0600

define BIND_8_COMPAT before including arpa/nameser.h in dns.c

On Mac OS X, defining BIND_8_COMPAT will include arpa/nameser_compat.h
from  use arpa/nameser.h.  Without Bind 8 compatibility, the
following errors are produced:

./compile dns.c
dns.c:30:18: error: use of undeclared identifier 'MAXDNAME'
static char name[MAXDNAME];
                 ^
dns.c:49:45: error: use of undeclared identifier 'PACKETSZ'
  if (response.buf = (unsigned char *)alloc(PACKETSZ+1))
                                            ^
dns.c:50:21: error: use of undeclared identifier 'PACKETSZ'
   responsebuflen = PACKETSZ+1;
                    ^
dns.c:53:30: error: use of undeclared identifier 'C_IN'
 responselen = lookup(glue.s,C_IN,type,response.buf,responsebuflen);
                             ^
dns.c:55:37: error: expected expression
     (responselen > 0 && (((HEADER *)response.buf)->tc)))
                                    ^
dns.c:55:29: error: use of undeclared identifier 'HEADER'
     (responselen > 0 && (((HEADER *)response.buf)->tc)))
                            ^
dns.c:63:33: error: use of undeclared identifier 'C_IN'
    responselen = lookup(glue.s,C_IN,type,response.buf,responsebuflen);
                                ^
dns.c:73:38: error: use of undeclared identifier 'HEADER'
 responsepos = response.buf + sizeof(HEADER);
                                     ^
dns.c:74:22: error: expected expression
 n = ntohs(((HEADER *)response.buf)->qdcount);
                     ^
dns.c:74:14: error: use of undeclared identifier 'HEADER'
 n = ntohs(((HEADER *)response.buf)->qdcount);
             ^
dns.c:74:22: error: expected expression
 n = ntohs(((HEADER *)response.buf)->qdcount);
                     ^
dns.c:74:14: error: use of undeclared identifier 'HEADER'
 n = ntohs(((HEADER *)response.buf)->qdcount);
             ^
dns.c:74:22: error: expected expression
 n = ntohs(((HEADER *)response.buf)->qdcount);
                     ^
dns.c:74:14: error: use of undeclared identifier 'HEADER'
 n = ntohs(((HEADER *)response.buf)->qdcount);
             ^
dns.c:74:22: error: expected expression
 n = ntohs(((HEADER *)response.buf)->qdcount);
                     ^
dns.c:74:14: error: use of undeclared identifier 'HEADER'
 n = ntohs(((HEADER *)response.buf)->qdcount);
             ^
dns.c:77:60: error: use of undeclared identifier 'MAXDNAME'
   i = dn_expand(response.buf,responseend,responsepos,name,MAXDNAME);
                                                           ^
dns.c:81:12: error: use of undeclared identifier 'QFIXEDSZ'
   if (i < QFIXEDSZ) return DNS_SOFT;
           ^
dns.c:82:19: error: use of undeclared identifier 'QFIXEDSZ'
   responsepos += QFIXEDSZ;
                  ^
fatal error: too many errors emitted, stopping now [-ferror-limit=]
20 errors generated.

Diffstat:
Mdns.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git a/dns.c b/dns.c @@ -2,6 +2,9 @@ #include <netdb.h> #include <sys/types.h> #include <netinet/in.h> +#ifndef BIND_8_COMPAT +#define BIND_8_COMPAT /* Mac OS X: if Bind 9, Bind 8 compatibility */ +#endif #include <arpa/nameser.h> #include <resolv.h> #include <errno.h>