From 09dd16b981c38cbde7573398cb50ae1cf0531ade Mon Sep 17 00:00:00 2001 From: om Date: Mon, 10 Apr 2006 22:50:41 +0000 Subject: Route some more stuff through socket.h and hash_map.h. Add #define protection to timer.h and remove some unneeded includes and externs from timer.cpp git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@3869 e03df62e-2008-0410-955e-edbf42e46eb7 --- include/dns.h | 4 +--- include/hash_map.h | 4 ++++ include/inspsocket.h | 19 ++----------------- include/socket.h | 3 ++- include/timer.h | 4 ++++ include/typedefs.h | 10 +++------- src/timer.cpp | 16 +++------------- 7 files changed, 19 insertions(+), 41 deletions(-) diff --git a/include/dns.h b/include/dns.h index cdc1fd024..e907c7e2c 100644 --- a/include/dns.h +++ b/include/dns.h @@ -18,10 +18,8 @@ Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA #ifndef _DNS_H #define _DNS_H -#include -#include -#include #include +#include "socket.h" struct dns_ip4list { in_addr ip; diff --git a/include/hash_map.h b/include/hash_map.h index f74dce92a..39529634a 100644 --- a/include/hash_map.h +++ b/include/hash_map.h @@ -21,11 +21,15 @@ #include "inspircd_config.h" #ifdef GCC3 + #include #define nspace __gnu_cxx + #else + #include #define nspace std + #endif #endif diff --git a/include/inspsocket.h b/include/inspsocket.h index caa1490b5..c9cc70acf 100644 --- a/include/inspsocket.h +++ b/include/inspsocket.h @@ -17,27 +17,12 @@ #ifndef __INSP_SOCKET_H__ #define __INSP_SOCKET_H__ -#include -#include -#include #include #include #include -#include "dns.h" #include "inspircd_config.h" - -/* macros to the relevant system address description structs */ -#ifdef IPV6 - -typedef struct sockaddr_in6 insp_sockaddr; -typedef struct in6_addr insp_inaddr; - -#else - -typedef struct sockaddr_in insp_sockaddr; -typedef struct in_addr insp_inaddr; - -#endif +#include "dns.h" +#include "socket.h" /** * States which a socket may be in diff --git a/include/socket.h b/include/socket.h index 1dd2e6827..89b5ca1a4 100644 --- a/include/socket.h +++ b/include/socket.h @@ -36,8 +36,9 @@ #else -#include +#include #include +typedef int socklen_t; #endif diff --git a/include/timer.h b/include/timer.h index 3c4fb0897..6a4c9063b 100644 --- a/include/timer.h +++ b/include/timer.h @@ -14,6 +14,9 @@ * --------------------------------------------------- */ +#ifndef INSPIRCD_TIMER_H +#define INSPIRCD_TIMER_H + /** Timer class for one-second resolution timers * InspTimer provides a facility which allows module * developers to create one-shot timers. The timer @@ -55,3 +58,4 @@ void TickTimers(time_t TIME); void AddTimer(InspTimer* T); void TickMissedTimers(time_t TIME); +#endif diff --git a/include/typedefs.h b/include/typedefs.h index 1bb65bebe..cd8c82039 100644 --- a/include/typedefs.h +++ b/include/typedefs.h @@ -1,6 +1,9 @@ #ifndef __TYPEDEF_H__ #define __TYPEDEF_H__ +#include +#include "inspircd_config.h" +#include "hash_map.h" #include "users.h" #include "channels.h" #include "hashcomp.h" @@ -9,13 +12,6 @@ #include "inspircd.h" #include "modules.h" #include "globals.h" -#include "inspircd_config.h" -#include -#ifdef GCC3 -#include -#else -#include -#endif typedef nspace::hash_map, irc::StrHashComp> user_hash; typedef nspace::hash_map, irc::StrHashComp> chan_hash; diff --git a/src/timer.cpp b/src/timer.cpp index 0e7a77ad8..0c2cabbbe 100644 --- a/src/timer.cpp +++ b/src/timer.cpp @@ -14,24 +14,14 @@ * --------------------------------------------------- */ -using namespace std; - -#include "inspircd_config.h" -#include #include #include -#include "users.h" -#include "ctables.h" -#include "typedefs.h" -#include "commands.h" -#include "globals.h" -#include "hashcomp.h" +#include "inspircd_config.h" #include "inspircd.h" -#include "inspstring.h" +#include "typedefs.h" #include "helperfuncs.h" +#include "timer.h" -extern InspIRCd* ServerInstance; -extern ServerConfig* Config; extern time_t TIME; typedef std::vector timergroup; -- cgit v1.2.3