From b1a82220c1433c0cff2465300bc2b2dfbf4cd8eb Mon Sep 17 00:00:00 2001 From: frostycoolslug Date: Sat, 27 Sep 2003 18:58:37 +0000 Subject: Added Support for GCC 2 back. Port Default type is now 'clients' git-svn-id: http://svn.inspircd.org/repository/trunk/inspircd@191 e03df62e-2008-0410-955e-edbf42e46eb7 --- src/inspircd.cpp | 52 +++++++++++++++++++++++++++++++--------------------- 1 file changed, 31 insertions(+), 21 deletions(-) (limited to 'src') diff --git a/src/inspircd.cpp b/src/inspircd.cpp index 065e94524..6350bf659 100644 --- a/src/inspircd.cpp +++ b/src/inspircd.cpp @@ -28,7 +28,11 @@ #include #include #include +#ifdef GCC3 #include +#else +#include +#endif #include #include #include @@ -45,6 +49,12 @@ using namespace std; +#ifdef GCC3 +#define nspace __gnu_cxx +#else +#define nspace std +#endif + int LogLevel = DEFAULT; char ServerName[MAXBUF]; char Network[MAXBUF]; @@ -70,9 +80,9 @@ extern vector factory; extern int MODCOUNT; -namespace __gnu_cxx +namespace nspace { - template<> struct __gnu_cxx::hash + template<> struct nspace::hash { size_t operator()(const struct in_addr &a) const { @@ -82,7 +92,7 @@ namespace __gnu_cxx } }; - template<> struct __gnu_cxx::hash + template<> struct nspace::hash { size_t operator()(const string &s) const { @@ -126,9 +136,9 @@ struct InAddr_HashComp }; -typedef __gnu_cxx::hash_map, StrHashComp> user_hash; -typedef __gnu_cxx::hash_map, StrHashComp> chan_hash; -typedef __gnu_cxx::hash_map, InAddr_HashComp> address_cache; +typedef nspace::hash_map, StrHashComp> user_hash; +typedef nspace::hash_map, StrHashComp> chan_hash; +typedef nspace::hash_map, InAddr_HashComp> address_cache; typedef std::deque command_table; serverrec* me[32]; @@ -4037,25 +4047,25 @@ int InspIRCd(void) ConfValue("bind","port",count,configToken); ConfValue("bind","address",count,Addr); ConfValue("bind","type",count,Type); - if (!strcmp(Type,"clients")) + if (!strcmp(Type,"servers")) { - ports[count2] = atoi(configToken); - strcpy(addrs[count2],Addr); - count2++; + char Default[MAXBUF]; + strcpy(Default,"no"); + ConfValue("bind","default",count,Default); + if (strchr(Default,'y')) + { + defaultRoute = count3; + log(DEBUG,"InspIRCd: startup: binding '%s:%s' is default server route",Addr,configToken); + } + me[count3] = new serverrec(ServerName,100L,false); + me[count3]->CreateListener(Addr,atoi(configToken)); + count3++; } else { - char Default[MAXBUF]; - strcpy(Default,"no"); - ConfValue("bind","default",count,Default); - if (strchr(Default,'y')) - { - defaultRoute = count3; - log(DEBUG,"InspIRCd: startup: binding '%s:%s' is default server route",Addr,configToken); - } - me[count3] = new serverrec(ServerName,100L,false); - me[count3]->CreateListener(Addr,atoi(configToken)); - count3++; + ports[count2] = atoi(configToken); + strcpy(addrs[count2],Addr); + count2++; } log(DEBUG,"InspIRCd: startup: read binding %s:%s [%s] from config",Addr,configToken, Type); } -- cgit v1.2.3