From: Guus Sliepen Date: Sun, 25 May 2014 14:25:31 +0000 (+0200) Subject: Allow MeshLink to be cross-compiled for Windows. X-Git-Url: https://git.meshlink.io/?a=commitdiff_plain;h=f1101fcd6147b5b2cf767caf1db7a42508bd640d;p=meshlink Allow MeshLink to be cross-compiled for Windows. --- diff --git a/src/ed25519/seed.c b/src/ed25519/seed.c index 25e51822..11a2e3ec 100644 --- a/src/ed25519/seed.c +++ b/src/ed25519/seed.c @@ -3,8 +3,8 @@ #ifndef ED25519_NO_SEED #ifdef _WIN32 -#include -#include +#include +#include #else #include #endif @@ -37,4 +37,4 @@ int ed25519_create_seed(unsigned char *seed) { return 0; } -#endif \ No newline at end of file +#endif diff --git a/src/meshlink.c b/src/meshlink.c index 816f77ab..21838ab7 100644 --- a/src/meshlink.c +++ b/src/meshlink.c @@ -40,6 +40,9 @@ typedef struct { #include "xalloc.h" #include "ed25519/sha512.h" +#ifndef MSG_NOSIGNAL +#define MSG_NOSIGNAL 0 +#endif //TODO: this can go away completely const var_t variables[] = { diff --git a/src/meshlink_internal.h b/src/meshlink_internal.h index 7976a55a..ca2e0bc5 100644 --- a/src/meshlink_internal.h +++ b/src/meshlink_internal.h @@ -29,6 +29,8 @@ #include "sockaddr.h" #include "sptps.h" +#include + #define MAXSOCKETS 8 /* Probably overkill... */ typedef struct listen_socket_t { diff --git a/src/net_socket.c b/src/net_socket.c index 2ddf837b..7b6c493b 100644 --- a/src/net_socket.c +++ b/src/net_socket.c @@ -58,13 +58,13 @@ static void configure_tcp(connection_t *c) { #endif #if defined(SOL_TCP) && defined(TCP_NODELAY) - option = 1; - setsockopt(c->socket, SOL_TCP, TCP_NODELAY, (void *)&option, sizeof option); + int nodelay = 1; + setsockopt(c->socket, SOL_TCP, TCP_NODELAY, (void *)&nodelay, sizeof nodelay); #endif #if defined(SOL_IP) && defined(IP_TOS) && defined(IPTOS_LOWDELAY) - option = IPTOS_LOWDELAY; - setsockopt(c->socket, SOL_IP, IP_TOS, (void *)&option, sizeof option); + int lowdelay = IPTOS_LOWDELAY; + setsockopt(c->socket, SOL_IP, IP_TOS, (void *)&lowdelay, sizeof lowdelay); #endif }