From fa2cf9bea837e17d08218d0070a60905adec268f Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 9 Aug 2010 18:48:57 -0600 Subject: Fix enet version check *again* Reviewed-by: Chuck Miller --- src/net/manaserv/connection.cpp | 2 +- src/net/manaserv/connection.h | 6 ++++++ src/net/manaserv/network.cpp | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/net/manaserv/connection.cpp b/src/net/manaserv/connection.cpp index 3978a0d8..b404191f 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. -#if defined(ENET_VERSION) && ENET_VERSION >= ENET_VERSION_CREATE(1,3,0) +#if defined(ENET_VERSION) && ENET_VERSION >= ENET_CUTOFF mConnection = enet_host_connect(mClient, &enetAddress, 1, 0); #else mConnection = enet_host_connect(mClient, &enetAddress, 1); diff --git a/src/net/manaserv/connection.h b/src/net/manaserv/connection.h index b39f8957..808a6d40 100644 --- a/src/net/manaserv/connection.h +++ b/src/net/manaserv/connection.h @@ -26,6 +26,12 @@ #include +#ifdef ENET_VERSION_CREATE +#define ENET_CUTOFF ENET_VERSION_CREATE(1,3,0) +#else +#define ENET_CUTOFF 0xFFFFFFFF +#endif + namespace ManaServ { class MessageOut; diff --git a/src/net/manaserv/network.cpp b/src/net/manaserv/network.cpp index aa0342eb..607100b7 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."); } -#if defined(ENET_VERSION) && ENET_VERSION >= ENET_VERSION_CREATE(1,3,0) +#if defined(ENET_VERSION) && ENET_VERSION >= ENET_CUTOFF client = enet_host_create(NULL, 3, 0, 0, 0); #else client = enet_host_create(NULL, 3, 0, 0); -- cgit v1.2.3-70-g09d2