From ebfe4282d3323fa03cb73b758d84bb200e338fed Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 15 Jan 2022 13:25:17 +0100 Subject: [PATCH 1/3] Fixed Windows compile of FriendServer --- retroshare-friendserver/src/network.cc | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/retroshare-friendserver/src/network.cc b/retroshare-friendserver/src/network.cc index 3f1f59964..3ed5b22a2 100644 --- a/retroshare-friendserver/src/network.cc +++ b/retroshare-friendserver/src/network.cc @@ -26,9 +26,6 @@ #include #include #include -#include -#include -#include #include "util/rsnet.h" #include "util/rsprint.h" @@ -48,8 +45,7 @@ FsNetworkInterface::FsNetworkInterface(const std::string& listening_address,uint mClintListn = 0; mClintListn = socket(AF_INET, SOCK_STREAM, 0); // creating socket - int flags = fcntl(mClintListn, F_GETFL); - fcntl(mClintListn, F_SETFL, flags | O_NONBLOCK); + unix_fcntl_nonblock(mClintListn); struct sockaddr_in ipOfServer; memset(&ipOfServer, '0', sizeof(ipOfServer)); @@ -149,8 +145,7 @@ bool FsNetworkInterface::checkForNewConnections() // Make the socket non blocking so that we can read from it and return if nothing comes - int flags = fcntl(clintConnt, F_GETFL); - fcntl(clintConnt, F_SETFL, flags | O_NONBLOCK); + unix_fcntl_nonblock(clintConnt); // Create connection info From 69b96e2c1b83061ae06c63d8bfc6276c1b8e850c Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 15 Jan 2022 18:38:24 +0100 Subject: [PATCH 2/3] Fixed linking of FriendServer with MSYS2 on Windows --- retroshare-friendserver/src/retroshare-friendserver.pro | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/retroshare-friendserver/src/retroshare-friendserver.pro b/retroshare-friendserver/src/retroshare-friendserver.pro index 79986b461..61c604e43 100644 --- a/retroshare-friendserver/src/retroshare-friendserver.pro +++ b/retroshare-friendserver/src/retroshare-friendserver.pro @@ -39,5 +39,12 @@ unix { INSTALLS += target } +################################# Windows ########################################## + +win32-g++|win32-clang-g++ { + dLib = ws2_32 iphlpapi crypt32 + LIBS *= $$linkDynamicLibs(dLib) +} + ################################### COMMON stuff ################################## From 36f14c80241520c5be4ec3ef34362de8af42e3a3 Mon Sep 17 00:00:00 2001 From: thunder2 Date: Sat, 15 Jan 2022 18:42:21 +0100 Subject: [PATCH 3/3] Removed unnecessary CFLAGS for Windows compile --- retroshare-service/src/retroshare-service.pro | 4 ---- 1 file changed, 4 deletions(-) diff --git a/retroshare-service/src/retroshare-service.pro b/retroshare-service/src/retroshare-service.pro index 82eda34c6..2c7a3d094 100644 --- a/retroshare-service/src/retroshare-service.pro +++ b/retroshare-service/src/retroshare-service.pro @@ -94,10 +94,6 @@ win32-g++|win32-clang-g++ { CONFIG -= console } - # Switch on extra warnings - QMAKE_CFLAGS += -Wextra - QMAKE_CXXFLAGS += -Wextra - CONFIG(debug, debug|release) { } else { # Tell linker to use ASLR protection