]> git.meshlink.io Git - meshlink/commitdiff
Allow MeshLink to be cross-compiled for Windows.
authorGuus Sliepen <guus@meshlink.io>
Sun, 25 May 2014 14:25:31 +0000 (16:25 +0200)
committerGuus Sliepen <guus@meshlink.io>
Sun, 25 May 2014 14:25:31 +0000 (16:25 +0200)
src/ed25519/seed.c
src/meshlink.c
src/meshlink_internal.h
src/net_socket.c

index 25e518220f742c970bf07299a32a7379ecd20c72..11a2e3ec460e22aa682b501fb171fbd3e9052891 100644 (file)
@@ -3,8 +3,8 @@
 #ifndef ED25519_NO_SEED
 
 #ifdef _WIN32
-#include <Windows.h>
-#include <Wincrypt.h>
+#include <windows.h>
+#include <wincrypt.h>
 #else
 #include <stdio.h>
 #endif
@@ -37,4 +37,4 @@ int ed25519_create_seed(unsigned char *seed) {
     return 0;
 }
 
-#endif
\ No newline at end of file
+#endif
index 816f77abe630540d7f3f2724be887d505c0cd4e0..21838ab7d34b919251a0857c5863904020b35030 100644 (file)
@@ -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[] = {
index 7976a55a7bb21a6be21c683b0e8b317df9dce895..ca2e0bc5c4904bf32931375dcd7d8c4356f0e240 100644 (file)
@@ -29,6 +29,8 @@
 #include "sockaddr.h"
 #include "sptps.h"
 
+#include <pthread.h>
+
 #define MAXSOCKETS 8    /* Probably overkill... */
 
 typedef struct listen_socket_t {
index 2ddf837b0a357589df87b280ccb9c512dfa6880b..7b6c493baeb30cc84935479a95d5e62e87a644f3 100644 (file)
@@ -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
 }