diff options
Diffstat (limited to 'src/net/connection.cpp')
-rw-r--r-- | src/net/connection.cpp | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/src/net/connection.cpp b/src/net/connection.cpp index 790b6ac7..ceed6f02 100644 --- a/src/net/connection.cpp +++ b/src/net/connection.cpp @@ -36,17 +36,15 @@ bool Connection::start(const std::string &address, int port) enet_address_set_host(&enetAddress, address.c_str()); enetAddress.port = port; -#if ENET_VERSION_MAJOR != 1 -#error Unsuported enet version! -#elif ENET_VERSION_MINOR < 3 +#ifdef ENET_VERSION_MAJOR mLocal = enet_host_create(NULL /* create a client host */, 1 /* allow one outgoing connection */, + 0 /* unlimited channel count */, 0 /* assume any amount of incoming bandwidth */, 0 /* assume any amount of outgoing bandwidth */); #else mLocal = enet_host_create(NULL /* create a client host */, 1 /* allow one outgoing connection */, - 0 /* unlimited channel count */, 0 /* assume any amount of incoming bandwidth */, 0 /* assume any amount of outgoing bandwidth */); #endif @@ -55,12 +53,10 @@ bool Connection::start(const std::string &address, int port) return false; // Initiate the connection, allocating channel 0. -#if ENET_VERSION_MAJOR != 1 -#error Unsuported enet version! -#elif ENET_VERSION_MINOR < 3 - mRemote = enet_host_connect(mLocal, &enetAddress, 1); -#else +#ifdef ENET_VERSION_MAJOR mRemote = enet_host_connect(mLocal, &enetAddress, 1, 0); +#else + mRemote = enet_host_connect(mLocal, &enetAddress, 1); #endif ENetEvent event; |