Skip to content

Commit

Permalink
Rearrange some headers to make sure that out nbase errno defines are …
Browse files Browse the repository at this point in the history
…seen early,

avoiding warning about symbol redefinitions. This is mostly moving "nmap.h" to
the top of the list.
  • Loading branch information
david committed Nov 4, 2010
1 parent fa320a9 commit d4e49f1
Show file tree
Hide file tree
Showing 11 changed files with 33 additions and 22 deletions.
3 changes: 2 additions & 1 deletion MACLookup.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,12 +91,13 @@

/* $Id$ */

#include "nmap.h"

#include <map>

/* Character pool memory allocation */
#include "MACLookup.h"
#include "NmapOps.h"
#include "nmap.h"
#include "nmap_error.h"
#include "charpool.h"

Expand Down
12 changes: 6 additions & 6 deletions nmap_dns.cc
Original file line number Diff line number Diff line change
Expand Up @@ -148,12 +148,6 @@
#include "nmap_winconfig.h"
#endif

#include <stdlib.h>
#include <limits.h>
#include <list>
#include <vector>
#include <algorithm>

#include "nmap.h"
#include "NmapOps.h"
#include "nmap_dns.h"
Expand All @@ -163,6 +157,12 @@
#include "timing.h"
#include "Target.h"

#include <stdlib.h>
#include <limits.h>
#include <list>
#include <vector>
#include <algorithm>

extern NmapOps o;


Expand Down
2 changes: 2 additions & 0 deletions nmap_tty.cc
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,8 @@
#include "nmap_config.h"
#endif

#include "nmap.h"

#include <sys/types.h>
#if HAVE_SYS_STAT_H
#include <sys/stat.h>
Expand Down
1 change: 1 addition & 0 deletions nse_debug.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ extern "C" {
#include "lauxlib.h"
}

#include "nmap.h"
#include "nse_debug.h"
#include "output.h"

Expand Down
15 changes: 8 additions & 7 deletions nse_fs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ extern "C" {
#include "lauxlib.h"
}

#include <string>
#include "nmap.h"
#include "nse_fs.h"
#include "nmap_error.h"
#include "NmapOps.h"

#include <errno.h>
#include <string.h>

#include <string>

#ifndef WIN32
#include "dirent.h"
#endif

#include "errno.h"
#include "nse_fs.h"
#include "nmap.h"
#include "nmap_error.h"
#include "NmapOps.h"

#define DIR_METATABLE "dir"

#ifndef MAXPATHLEN
Expand Down
1 change: 1 addition & 0 deletions output.cc
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@

/* $Id$ */

#include "nmap.h"
#include "output.h"
#include "osscan.h"
#include "NmapOps.h"
Expand Down
2 changes: 2 additions & 0 deletions payload.cc
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@

/* $Id$ */

#include "nmap.h"

#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
Expand Down
2 changes: 1 addition & 1 deletion portlist.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,9 +90,9 @@
/* $Id$ */


#include "nmap.h"
#include "portlist.h"
#include "nmap_error.h"
#include "nmap.h"
#include "NmapOps.h"
#include "services.h"
#include "protocols.h"
Expand Down
3 changes: 2 additions & 1 deletion portreasons.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@
* Written by Eddie Bell <ejlbell@gmail.com> 2007
*/

#include <iostream>
#include "nmap.h"
#include "portlist.h"
#include "NmapOps.h"
Expand All @@ -101,6 +100,8 @@
#include "winfix.h"
#endif

#include <iostream>

extern NmapOps o;
class PortList;

Expand Down
7 changes: 4 additions & 3 deletions services.cc
Original file line number Diff line number Diff line change
Expand Up @@ -90,15 +90,16 @@

/* $Id$ */

#include <list>
#include <map>

#include "nmap.h"
#include "services.h"
#include "NmapOps.h"
#include "charpool.h"
#include "nmap_error.h"
#include "utils.h"

#include <list>
#include <map>

/* This structure is the key for looking up services in the
port/proto -> service map. */
struct port_spec {
Expand Down
7 changes: 4 additions & 3 deletions xml.cc
Original file line number Diff line number Diff line change
Expand Up @@ -145,14 +145,15 @@ All writing is done with log_write(LOG_XML), so if LOG_XML hasn't been
opened, calling these functions has no effect.
*/

#include "nmap.h"
#include "output.h"
#include "xml.h"

#include <assert.h>
#include <stdarg.h>
#include <stdio.h>
#include <list>

#include "output.h"
#include "xml.h"

struct xml_writer {
/* Sanity checking: Don't open a new tag while still defining
attributes for another, like "<elem1<elem2". */
Expand Down

0 comments on commit d4e49f1

Please sign in to comment.