From 71ea8233334803a079ad24396ead02280a80d8d4 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 2 Aug 2010 20:49:37 -0600 Subject: Fix enet version check Tested-by: BaseBallBoy --- src/net/manaserv/connection.cpp | 8 +++----- src/net/manaserv/network.cpp | 8 +++----- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp index 063c364b..fbd2ed22 100644 --- a/src/net/manaserv/connection.cpp +++ b/src/net/manaserv/connection.cpp @@ -60,12 +60,10 @@ bool Connection::connect(const std::string &address, short port) enetAddress.port = port; // Initiate the connection, allocating channel 0. -#if ENET_VERSION_MAJOR != 1 -#error Unsuported enet version! -#elif ENET_VERSION_MINOR < 3 - mConnection = enet_host_connect(mClient, &enetAddress, 1); -#else +#ifdef ENET_VERSION_MAJOR mConnection = enet_host_connect(mClient, &enetAddress, 1, 0); +#else + mConnection = enet_host_connect(mClient, &enetAddress, 1); #endif if (!mConnection) diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp index 7c9bb864..4b9751d7 100644 --- a/src/net/manaserv/network.cpp +++ b/src/net/manaserv/network.cpp @@ -53,12 +53,10 @@ void initialize() logger->error("Failed to initialize ENet."); } -#if ENET_VERSION_MAJOR != 1 -#error Unsuported enet version! -#elif ENET_VERSION_MINOR < 3 - client = enet_host_create(NULL, 3, 0, 0); -#else +#ifdef ENET_VERSION_MAJOR client = enet_host_create(NULL, 3, 0, 0, 0); +#else + client = enet_host_create(NULL, 3, 0, 0); #endif if (!client) -- cgit v1.2.3-70-g09d2