summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-08-08 23:06:20 +0200
committerThorbjørn Lindeijer <thorbjorn@lindeijer.nl>2010-08-08 23:07:23 +0200
commitd51e707dff682e86c2d390b9e24981f511fa03c9 (patch)
tree0fc3539bf6d9caa448be5bdd60b5268c40a94e11
parent3e4b273b55b7a92f99202f81be9b4c2c906d2e79 (diff)
downloadmana-d51e707dff682e86c2d390b9e24981f511fa03c9.tar.gz
mana-d51e707dff682e86c2d390b9e24981f511fa03c9.tar.bz2
mana-d51e707dff682e86c2d390b9e24981f511fa03c9.tar.xz
mana-d51e707dff682e86c2d390b9e24981f511fa03c9.zip
Do proper checks on the ENet version
The previous check broke compilation against ENet 1.2.2, which does define the version macros but does not have the API changes.
-rw-r--r--src/net/manaserv/connection.cpp2
-rw-r--r--src/net/manaserv/network.cpp2
2 files changed, 2 insertions, 2 deletions
diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp
index fbd2ed22..3978a0d8 100644
--- a/src/net/manaserv/connection.cpp
+++ b/src/net/manaserv/connection.cpp
@@ -60,7 +60,7 @@ bool Connection::connect(const std::string &address, short port)
enetAddress.port = port;
// Initiate the connection, allocating channel 0.
-#ifdef ENET_VERSION_MAJOR
+#if defined(ENET_VERSION) && ENET_VERSION >= ENET_VERSION_CREATE(1,3,0)
mConnection = enet_host_connect(mClient, &enetAddress, 1, 0);
#else
mConnection = enet_host_connect(mClient, &enetAddress, 1);
diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp
index 4b9751d7..aa0342eb 100644
--- a/src/net/manaserv/network.cpp
+++ b/src/net/manaserv/network.cpp
@@ -53,7 +53,7 @@ void initialize()
logger->error("Failed to initialize ENet.");
}
-#ifdef ENET_VERSION_MAJOR
+#if defined(ENET_VERSION) && ENET_VERSION >= ENET_VERSION_CREATE(1,3,0)
client = enet_host_create(NULL, 3, 0, 0, 0);
#else
client = enet_host_create(NULL, 3, 0, 0);