Include <netdb.h> before <pcap-namedb.h>, as <netdb.h> is included to
define a structure used by <pcap-namedb.h>, and include <sys/socket.h> before <netdb.h>, as <sys/socket.h> is included to define a structure used by <netdb.h> (only a pointer to the first structure is used in <pcap-namedb.h>, and only a pointer to the second structure is used by <netdb.h>, so code will compile no matter which order you include them in, but it's a bit cleaner to include <sys/socket.h> before <netdb.h> and to include <netdb.h> before <pcap-namedb.h>). Indicate why we're including <netdb.h> and <sys/socket.h>.
This commit is contained in:
parent
67a0588585
commit
da10d3ec7f
|
@ -22,7 +22,7 @@
|
||||||
|
|
||||||
#ifndef lint
|
#ifndef lint
|
||||||
static const char rcsid[] =
|
static const char rcsid[] =
|
||||||
"@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.81 2001-09-14 01:40:57 fenner Exp $ (LBL)";
|
"@(#) $Header: /tcpdump/master/libpcap/scanner.l,v 1.82 2002-04-07 00:42:51 guy Exp $ (LBL)";
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HAVE_CONFIG_H
|
#ifdef HAVE_CONFIG_H
|
||||||
|
@ -39,15 +39,15 @@ static const char rcsid[] =
|
||||||
#include "pcap-int.h"
|
#include "pcap-int.h"
|
||||||
|
|
||||||
#include "gencode.h"
|
#include "gencode.h"
|
||||||
#include <pcap-namedb.h>
|
|
||||||
#ifdef INET6
|
#ifdef INET6
|
||||||
#include <netdb.h>
|
#include <sys/socket.h> /* for "struct sockaddr" in "struct addrinfo" */
|
||||||
#include <sys/socket.h>
|
#include <netdb.h> /* for "struct addrinfo" */
|
||||||
/* Workaround for AIX 4.3 */
|
/* Workaround for AIX 4.3 */
|
||||||
#if !defined(AI_NUMERICHOST)
|
#if !defined(AI_NUMERICHOST)
|
||||||
#define AI_NUMERICHOST 0x04
|
#define AI_NUMERICHOST 0x04
|
||||||
#endif
|
#endif
|
||||||
#endif /*INET6*/
|
#endif /*INET6*/
|
||||||
|
#include <pcap-namedb.h>
|
||||||
#include "tokdefs.h"
|
#include "tokdefs.h"
|
||||||
|
|
||||||
#ifdef HAVE_OS_PROTO_H
|
#ifdef HAVE_OS_PROTO_H
|
||||||
|
|
Reference in New Issue