From b5c98b278ea09934700ca2e8f03650ea19be1fd1 Mon Sep 17 00:00:00 2001 From: Jared Adams Date: Mon, 9 Aug 2010 18:53:40 -0600 Subject: Fix enet version check Reviewed-by: Chuck Miller --- src/net/connectionhandler.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/net/connectionhandler.cpp') diff --git a/src/net/connectionhandler.cpp b/src/net/connectionhandler.cpp index 986d9de..314eb0f 100644 --- a/src/net/connectionhandler.cpp +++ b/src/net/connectionhandler.cpp @@ -29,6 +29,12 @@ #include "net/netcomputer.hpp" #include "utils/logger.h" +#ifdef ENET_VERSION_CREATE +#define ENET_CUTOFF ENET_VERSION_CREATE(1,3,0) +#else +#define ENET_CUTOFF 0xFFFFFFFF +#endif + bool ConnectionHandler::startListen(enet_uint16 port, const std::string &listenHost) { @@ -40,7 +46,7 @@ bool ConnectionHandler::startListen(enet_uint16 port, enet_address_set_host(&address, listenHost.c_str()); LOG_INFO("Listening on port " << port << "..."); -#ifdef ENET_VERSION_MAJOR +#ifdef defined(ENET_VERSION) && ENET_VERSION >= ENET_CUTOFF host = enet_host_create( &address /* the address to bind the server host to */, Configuration::getValue("net_maxClients", 1000) /* allowed connections */, -- cgit