Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build fixes for Linux, UWP and CMake #157

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
cmake_minimum_required(VERSION 2.6)
cmake_minimum_required(VERSION 2.9)

project(enet)

Expand Down
2 changes: 1 addition & 1 deletion protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -1390,7 +1390,7 @@ enet_protocol_check_outgoing_commands (ENetHost * host, ENetPeer * peer)
ENetBuffer * buffer = & host -> buffers [host -> bufferCount];
ENetOutgoingCommand * outgoingCommand;
ENetListIterator currentCommand;
ENetChannel *channel;
ENetChannel *channel = NULL;
enet_uint16 reliableWindow;
size_t commandSize;
int windowExceeded = 0, windowWrap = 0, canPing = 1;
Expand Down
3 changes: 3 additions & 0 deletions unix.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,12 @@
#include <poll.h>
#endif

// see https://github.com/lsalzman/enet/issues/90
#ifndef HAS_SOCKLEN_T
#ifndef __socklen_t_defined
typedef int socklen_t;
#endif
#endif

#ifndef MSG_NOSIGNAL
#define MSG_NOSIGNAL 0
Expand Down
14 changes: 14 additions & 0 deletions win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@

static enet_uint32 timeBase = 0;

#if defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
// if we are compiling for the Universal Windows Platform (UWP)
// the functions timeBeginPeriod, timeEndPeriod and timeGetTime are not available

void timeBeginPeriod(int) {}
void timeEndPeriod(int) {}

enet_uint32 timeGetTime()
{
return static_cast<enet_uint32>(GetTickCount64());
}

#endif

int
enet_initialize (void)
{
Expand Down