summaryrefslogtreecommitdiff
path: root/src/modules/extra/m_geoip.cpp
diff options
context:
space:
mode:
authorAdam <Adam@anope.org>2011-06-18 17:25:35 -0400
committerDaniel De Graaf <danieldg@inspircd.org>2011-06-18 17:25:35 -0400
commit699a8b2fc82949bfd5a39acc5b00670a5c350b4d (patch)
tree049720a0ad9396cb35832ebc776e8e34ce98f915 /src/modules/extra/m_geoip.cpp
parente46e50071fce0e6b47ef7712fae8465933bd618a (diff)
Fix extras compilation under Windows
Diffstat (limited to 'src/modules/extra/m_geoip.cpp')
-rw-r--r--src/modules/extra/m_geoip.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/modules/extra/m_geoip.cpp b/src/modules/extra/m_geoip.cpp
index cdd269003..5b78be88b 100644
--- a/src/modules/extra/m_geoip.cpp
+++ b/src/modules/extra/m_geoip.cpp
@@ -16,6 +16,10 @@
#include <GeoIP.h>
+#ifdef WINDOWS
+# pragma comment(lib, "GeoIP.lib")
+#endif
+
/* $ModDesc: Provides a way to restrict users by country using GeoIP lookup */
/* $LinkerFlags: -lGeoIP */
@@ -25,13 +29,16 @@ class ModuleGeoIP : public Module
GeoIP* gi;
public:
- ModuleGeoIP() : ext("geoip_cc", this)
+ ModuleGeoIP() : ext("geoip_cc", this), gi(NULL)
{
- gi = GeoIP_new(GEOIP_STANDARD);
}
void init()
{
+ gi = GeoIP_new(GEOIP_STANDARD);
+ if (gi == NULL)
+ throw ModuleException("Unable to initialize geoip, are you missing GeoIP.dat?");
+
ServerInstance->Modules->AddService(ext);
Implementation eventlist[] = { I_OnSetConnectClass };
ServerInstance->Modules->Attach(eventlist, this, 1);