diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake index 072128c18..d97c46ca2 100644 --- a/cmake/Libraries.cmake +++ b/cmake/Libraries.cmake @@ -163,9 +163,6 @@ macro(configure_unix_libs) message(WARNING "pkg-config not found, skipping wayland libraries") endif() endif() - - add_definitions(-DSYSAPI_UNIX=1) - endmacro() # diff --git a/src/apps/deskflow-daemon/DaemonApp.cpp b/src/apps/deskflow-daemon/DaemonApp.cpp index 322fd1f03..a0e392e24 100644 --- a/src/apps/deskflow-daemon/DaemonApp.cpp +++ b/src/apps/deskflow-daemon/DaemonApp.cpp @@ -157,7 +157,7 @@ int DaemonApp::daemonLoop() #if SYSAPI_WIN32 // Runs the daemon through the Windows service controller, which controls the program lifecycle. return ArchDaemonWindows::runDaemon([this]() { return mainLoop(); }); -#elif SYSAPI_UNIX +#else return mainLoop(); #endif } diff --git a/src/lib/arch/Arch.h b/src/lib/arch/Arch.h index d6c90acae..6c88f177b 100644 --- a/src/lib/arch/Arch.h +++ b/src/lib/arch/Arch.h @@ -32,7 +32,7 @@ #include "arch/win32/ArchMultithreadWindows.h" #include "arch/win32/ArchNetworkWinsock.h" -#elif SYSAPI_UNIX +#else #include "arch/ArchDaemonNone.h" #include "arch/unix/ArchLogUnix.h" diff --git a/src/lib/deskflow/App.h b/src/lib/deskflow/App.h index e14fb8162..18b138c8b 100644 --- a/src/lib/deskflow/App.h +++ b/src/lib/deskflow/App.h @@ -15,7 +15,7 @@ #if SYSAPI_WIN32 #include "deskflow/win32/AppUtilWindows.h" -#elif SYSAPI_UNIX +#else #include "deskflow/unix/AppUtilUnix.h" #endif diff --git a/src/lib/net/SecureSocket.cpp b/src/lib/net/SecureSocket.cpp index 65203ea9b..326074e4f 100644 --- a/src/lib/net/SecureSocket.cpp +++ b/src/lib/net/SecureSocket.cpp @@ -660,7 +660,7 @@ ISocketMultiplexerJob *SecureSocket::serviceConnect(ISocketMultiplexerJob *const int status = 0; #ifdef SYSAPI_WIN32 status = secureConnect(static_cast(getSocket()->m_socket)); -#elif SYSAPI_UNIX +#else status = secureConnect(getSocket()->m_fd); #endif @@ -688,7 +688,7 @@ ISocketMultiplexerJob *SecureSocket::serviceAccept(ISocketMultiplexerJob *const, int status = 0; #ifdef SYSAPI_WIN32 status = secureAccept(static_cast(getSocket()->m_socket)); -#elif SYSAPI_UNIX +#else status = secureAccept(getSocket()->m_fd); #endif // If status < 0, error happened diff --git a/src/lib/net/TCPListenSocket.cpp b/src/lib/net/TCPListenSocket.cpp index 2392ce87e..4e2883ed5 100644 --- a/src/lib/net/TCPListenSocket.cpp +++ b/src/lib/net/TCPListenSocket.cpp @@ -54,7 +54,7 @@ void TCPListenSocket::bind(const NetworkAddress &addr) try { std::scoped_lock lock{m_mutex}; -#if SYSAPI_UNIX +#if defined(Q_OS_UNIX) // Only reuse socket addr on Unix so we can restart the server quickly (Unix holds the port // in TIME_WAIT for a few mins after close). This is not needed on Windows and can cause issues // because binding to a re-use port makes it look like the server is listening when it is not.