Undo the damage from 2e51fb74be
This commit is contained in:
parent
dc010d6ec8
commit
0a7f0cd7d4
10 changed files with 43 additions and 58 deletions
|
@ -124,7 +124,7 @@ ENDIF()
|
||||||
|
|
||||||
# libepoll-shim needs to be installed on the BSDs and Mac OSX to get
|
# libepoll-shim needs to be installed on the BSDs and Mac OSX to get
|
||||||
# some of the server code to compile and work correctly on those platforms - Brad
|
# some of the server code to compile and work correctly on those platforms - Brad
|
||||||
IF(UNIX AND NOT LINUX AND NOT CYGWIN)
|
IF(CMAKE_SYSTEM_NAME MATCHES "BSD" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
INCLUDE(FetchContent)
|
INCLUDE(FetchContent)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
epoll-shim
|
epoll-shim
|
||||||
|
@ -523,10 +523,11 @@ ELSEIF(UNIX AND NOT FTE_USE_SDL) #linux(ish)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT LINUX AND NOT CYGWIN)
|
IF(CMAKE_SYSTEM_NAME MATCHES "BSD" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
FIND_LIBRARY(epoll-shim REQUIRED)
|
FIND_LIBRARY(epoll-shim REQUIRED)
|
||||||
INCLUDE_DIRECTORIES(${EPOLL_INC_DIR})
|
INCLUDE_DIRECTORIES(${EPOLL_INC_DIR})
|
||||||
SET(FTESV_LIBS ${FTESV_LIBS} epoll-shim)
|
SET(FTESV_LIBS ${FTESV_LIBS} epoll-shim)
|
||||||
|
SET(FTESV_DEFINES ${FTESV_DEFINES};HAVE_EPOLL)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
SET(FTESV_DEFINES ${FTESV_DEFINES};MULTITHREAD)
|
SET(FTESV_DEFINES ${FTESV_DEFINES};MULTITHREAD)
|
||||||
|
@ -1091,10 +1092,11 @@ ELSE()
|
||||||
${FTE_CLIENT_FILES}
|
${FTE_CLIENT_FILES}
|
||||||
${FTE_SERVER_FILES}
|
${FTE_SERVER_FILES}
|
||||||
)
|
)
|
||||||
IF(UNIX AND NOT LINUX AND NOT CYGWIN)
|
IF(CMAKE_SYSTEM_NAME MATCHES "BSD" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
FIND_LIBRARY(epoll-shim REQUIRED)
|
FIND_LIBRARY(epoll-shim REQUIRED)
|
||||||
SET(FTE_INCLUDES ${FTE_INCLUDES} "${EPOLL_INC_DIR}")
|
SET(FTE_INCLUDES ${FTE_INCLUDES} "${EPOLL_INC_DIR}")
|
||||||
SET(FTE_LIBS ${FTE_LIBS} epoll-shim)
|
SET(FTE_LIBS ${FTE_LIBS} epoll-shim)
|
||||||
|
SET(FTE_DEFINES ${FTE_DEFINES};HAVE_EPOLL)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET_TARGET_PROPERTIES(fteqw PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES};${FTE_DEFINES};${FTE_REVISON}")
|
SET_TARGET_PROPERTIES(fteqw PROPERTIES COMPILE_DEFINITIONS "${FTE_LIB_DEFINES};${FTE_DEFINES};${FTE_REVISON}")
|
||||||
TARGET_INCLUDE_DIRECTORIES(fteqw PUBLIC ${FTE_INCLUDES})
|
TARGET_INCLUDE_DIRECTORIES(fteqw PUBLIC ${FTE_INCLUDES})
|
||||||
|
@ -1198,13 +1200,14 @@ ELSE()
|
||||||
SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON};${FTE_LIB_DEFINES}")
|
SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON};${FTE_LIB_DEFINES}")
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
TARGET_LINK_LIBRARIES(qtv ws2_32 winmm ${SYS_LIBS} ${FTEQTV_LIBS})
|
TARGET_LINK_LIBRARIES(qtv ws2_32 winmm ${SYS_LIBS} ${FTEQTV_LIBS})
|
||||||
ELSEIF(LINUX)
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "BSD" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
TARGET_LINK_LIBRARIES(qtv ${SYS_LIBS} ${FTEQTV_LIBS})
|
# Add Epoll-shim for the kqueue Unixes here - Brad
|
||||||
# Add Epoll-shim for the Unixes here - Brad
|
|
||||||
ELSE()
|
|
||||||
FIND_LIBRARY(epoll-shim REQUIRED)
|
FIND_LIBRARY(epoll-shim REQUIRED)
|
||||||
TARGET_INCLUDE_DIRECTORIES(qtv PUBLIC "${EPOLL_INC_DIR}")
|
TARGET_INCLUDE_DIRECTORIES(qtv PUBLIC "${EPOLL_INC_DIR}")
|
||||||
TARGET_LINK_LIBRARIES(qtv epoll-shim ${SYS_LIBS} ${FTEQTV_LIBS})
|
TARGET_LINK_LIBRARIES(qtv epoll-shim ${SYS_LIBS} ${FTEQTV_LIBS})
|
||||||
|
SET_TARGET_PROPERTIES(qtv PROPERTIES COMPILE_DEFINITIONS "${FTE_REVISON};${FTE_LIB_DEFINES};HAVE_EPOLL")
|
||||||
|
ELSE()
|
||||||
|
TARGET_LINK_LIBRARIES(qtv ${SYS_LIBS} ${FTEQTV_LIBS})
|
||||||
ENDIF()
|
ENDIF()
|
||||||
SET(INSTALLTARGS ${INSTALLTARGS} qtv)
|
SET(INSTALLTARGS ${INSTALLTARGS} qtv)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1247,10 +1250,11 @@ ELSE()
|
||||||
SET_TARGET_PROPERTIES(httpserver PROPERTIES COMPILE_DEFINITIONS "WEBSERVER;WEBSVONLY;${FTE_REVISON}")
|
SET_TARGET_PROPERTIES(httpserver PROPERTIES COMPILE_DEFINITIONS "WEBSERVER;WEBSVONLY;${FTE_REVISON}")
|
||||||
IF(WIN32)
|
IF(WIN32)
|
||||||
TARGET_LINK_LIBRARIES(httpserver ws2_32)
|
TARGET_LINK_LIBRARIES(httpserver ws2_32)
|
||||||
ELSEIF(UNIX AND NOT LINUX AND NOT CYGWIN)
|
ELSEIF(CMAKE_SYSTEM_NAME MATCHES "BSD" OR CMAKE_SYSTEM_NAME MATCHES "Darwin")
|
||||||
FIND_LIBRARY(epoll-shim REQUIRED)
|
FIND_LIBRARY(epoll-shim REQUIRED)
|
||||||
TARGET_INCLUDE_DIRECTORIES(httpserver PUBLIC "${EPOLL_INC_DIR}")
|
TARGET_INCLUDE_DIRECTORIES(httpserver PUBLIC "${EPOLL_INC_DIR}")
|
||||||
TARGET_LINK_LIBRARIES(httpserver epoll-shim)
|
TARGET_LINK_LIBRARIES(httpserver epoll-shim)
|
||||||
|
SET_TARGET_PROPERTIES(httpserver PROPERTIES COMPILE_DEFINITIONS "WEBSERVER;WEBSVONLY;${FTE_REVISON};HAVE_EPOLL")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
#SET(INSTALLTARGS ${INSTALLTARGS} httpserver)
|
#SET(INSTALLTARGS ${INSTALLTARGS} httpserver)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
@ -1711,7 +1715,6 @@ IF(FTE_PLUG_CEF)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
IF(NOT ANDROID) #libresolv issues.
|
|
||||||
SET(FTE_PLUG_XMPP true CACHE BOOL "Compile xmpp/jabber instant-messenger plugin.")
|
SET(FTE_PLUG_XMPP true CACHE BOOL "Compile xmpp/jabber instant-messenger plugin.")
|
||||||
IF(FTE_PLUG_XMPP)
|
IF(FTE_PLUG_XMPP)
|
||||||
#XMPP/jabber client plugin
|
#XMPP/jabber client plugin
|
||||||
|
@ -1726,14 +1729,16 @@ IF(FTE_PLUG_XMPP)
|
||||||
plugins/emailnot/md5.c
|
plugins/emailnot/md5.c
|
||||||
)
|
)
|
||||||
SET_TARGET_PROPERTIES(plug_xmpp PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
SET_TARGET_PROPERTIES(plug_xmpp PROPERTIES COMPILE_DEFINITIONS "FTEPLUGIN;${FTE_LIB_DEFINES}")
|
||||||
IF(${WIN32})
|
|
||||||
ELSEIF(LINUX OR APPLE)
|
#for SRV lookups, so we actually get the right server from account names/etc.
|
||||||
|
IF(ANDROID) #libresolv issues.
|
||||||
|
ELSEIF(${WIN32}) #softlinks a dll
|
||||||
|
ELSE()
|
||||||
TARGET_LINK_LIBRARIES(plug_xmpp ${SYS_LIBS} resolv)
|
TARGET_LINK_LIBRARIES(plug_xmpp ${SYS_LIBS} resolv)
|
||||||
ENDIF()
|
ENDIF()
|
||||||
|
|
||||||
EMBED_PLUGIN_META(xmpp "XMPP Plugin" "XMPP/Jabber instant messenger plugin for chatting without tabbing out.")
|
EMBED_PLUGIN_META(xmpp "XMPP Plugin" "XMPP/Jabber instant messenger plugin for chatting without tabbing out.")
|
||||||
ENDIF()
|
ENDIF()
|
||||||
ENDIF() #android
|
|
||||||
|
|
||||||
INSTALL(TARGETS ${INSTALLTARGS}
|
INSTALL(TARGETS ${INSTALLTARGS}
|
||||||
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${FTE_INSTALL_BINDIR}"
|
RUNTIME DESTINATION "${CMAKE_INSTALL_PREFIX}/${FTE_INSTALL_BINDIR}"
|
||||||
|
|
|
@ -132,10 +132,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#endif
|
#endif
|
||||||
#include <time.h>
|
#include <time.h>
|
||||||
|
|
||||||
#if defined(__unix__) && !defined(__CYGWIN__)
|
|
||||||
#include <sys/epoll.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef USE_MSVCRT_DEBUG
|
#ifdef USE_MSVCRT_DEBUG
|
||||||
#define _CRTDBG_MAP_ALLOC
|
#define _CRTDBG_MAP_ALLOC
|
||||||
#include <crtdbg.h>
|
#include <crtdbg.h>
|
||||||
|
|
|
@ -66,10 +66,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
|
|
||||||
#undef malloc
|
#undef malloc
|
||||||
|
|
||||||
#if defined(__unix__) && !defined(__CYGWIN__)
|
|
||||||
#include <sys/epoll.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
static int noconinput = 0;
|
static int noconinput = 0;
|
||||||
static int nostdout = 0;
|
static int nostdout = 0;
|
||||||
|
|
||||||
|
|
|
@ -21,13 +21,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
// console
|
// console
|
||||||
//
|
//
|
||||||
|
|
||||||
// undefine this to solve build issues with epoll-shim - Brad
|
|
||||||
#if defined(__unix__) && !defined(__linux__) && !defined(__CYGWIN__)
|
|
||||||
#ifdef close
|
|
||||||
#undef close
|
|
||||||
#endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#define MAXCONCOLOURS 16
|
#define MAXCONCOLOURS 16
|
||||||
typedef struct {
|
typedef struct {
|
||||||
float fr, fg, fb;
|
float fr, fg, fb;
|
||||||
|
|
|
@ -26,10 +26,6 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
|
||||||
#include <sys/stat.h> //to delete the file/socket.
|
#include <sys/stat.h> //to delete the file/socket.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__unix__) && !defined(__linux__) && !defined(__APPLE__) && !defined(__CYGWIN__)
|
|
||||||
#include <sys/epoll.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
extern ftemanifest_t *fs_manifest;
|
extern ftemanifest_t *fs_manifest;
|
||||||
|
|
||||||
// Eww, eww. This is hacky but so is netinc.h, so bite me
|
// Eww, eww. This is hacky but so is netinc.h, so bite me
|
||||||
|
@ -10499,6 +10495,7 @@ NET_Init
|
||||||
void NET_Init (void)
|
void NET_Init (void)
|
||||||
{
|
{
|
||||||
#ifdef HAVE_EPOLL
|
#ifdef HAVE_EPOLL
|
||||||
|
if (epoll_fd < 0)
|
||||||
epoll_fd = epoll_create1(EPOLL_CLOEXEC);
|
epoll_fd = epoll_create1(EPOLL_CLOEXEC);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -10898,7 +10895,7 @@ void NET_Shutdown (void)
|
||||||
|
|
||||||
#ifdef HAVE_EPOLL
|
#ifdef HAVE_EPOLL
|
||||||
if (epoll_fd >= 0)
|
if (epoll_fd >= 0)
|
||||||
close(epoll_fd);
|
epoll_close(epoll_fd);
|
||||||
epoll_fd = -1;
|
epoll_fd = -1;
|
||||||
stdin_epolling = false;
|
stdin_epolling = false;
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -140,7 +140,7 @@
|
||||||
#include <libc.h>
|
#include <libc.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__unix__) && !defined(__CYGWIN__)
|
#if defined(__linux__) || defined(HAVE_EPOLL)
|
||||||
//requires linux 2.6.27 up (and equivelent libc)
|
//requires linux 2.6.27 up (and equivelent libc)
|
||||||
//note that BSD does tend to support the api, but emulated.
|
//note that BSD does tend to support the api, but emulated.
|
||||||
//this works around the select FD limit, and supposedly has better performance.
|
//this works around the select FD limit, and supposedly has better performance.
|
||||||
|
@ -149,6 +149,13 @@
|
||||||
#define HAVE_EPOLL
|
#define HAVE_EPOLL
|
||||||
//#else too old, probably android...
|
//#else too old, probably android...
|
||||||
#endif
|
#endif
|
||||||
|
#if defined(close) //epoll-shim? stop it from breaking shit
|
||||||
|
#undef close
|
||||||
|
#undef fcntl
|
||||||
|
#define epoll_close epoll_shim_close
|
||||||
|
#else
|
||||||
|
#define epoll_close close
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(__MORPHOS__) && !defined(ixemul)
|
#if defined(__MORPHOS__) && !defined(ixemul)
|
||||||
|
|
|
@ -36,10 +36,6 @@ struct sockaddr;
|
||||||
struct sockaddr_qstorage;
|
struct sockaddr_qstorage;
|
||||||
int NetadrToSockadr (netadr_t *a, struct sockaddr_qstorage *s);
|
int NetadrToSockadr (netadr_t *a, struct sockaddr_qstorage *s);
|
||||||
|
|
||||||
#if defined(__unix__) && !defined(__CYGWIN__)
|
|
||||||
#include <sys/epoll.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
typedef qboolean iwboolean;
|
typedef qboolean iwboolean;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
|
|
|
@ -201,7 +201,7 @@ int COM_CheckParm(const char *parm)
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef _WIN32
|
#ifdef HAVE_EPOLL
|
||||||
struct stun_ctx
|
struct stun_ctx
|
||||||
{
|
{
|
||||||
struct epollctx_s pub;
|
struct epollctx_s pub;
|
||||||
|
@ -338,7 +338,9 @@ int main(int argc, char **argv)
|
||||||
WSADATA pointlesscrap;
|
WSADATA pointlesscrap;
|
||||||
WSAStartup(2, &pointlesscrap);
|
WSAStartup(2, &pointlesscrap);
|
||||||
#else
|
#else
|
||||||
|
#ifdef HAVE_EPOLL
|
||||||
int ep = epoll_create1(0);
|
int ep = epoll_create1(0);
|
||||||
|
#endif
|
||||||
signal(SIGPIPE, SIG_IGN); //so we don't crash out if a peer closes the socket half way through.
|
signal(SIGPIPE, SIG_IGN); //so we don't crash out if a peer closes the socket half way through.
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -416,7 +418,7 @@ int main(int argc, char **argv)
|
||||||
else
|
else
|
||||||
printf("Server is read only\n");
|
printf("Server is read only\n");
|
||||||
|
|
||||||
#ifdef _WIN32
|
#ifndef HAVE_EPOLL
|
||||||
while(1)
|
while(1)
|
||||||
{
|
{
|
||||||
if (ftpport)
|
if (ftpport)
|
||||||
|
@ -430,7 +432,6 @@ int main(int argc, char **argv)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
||||||
while (!HTTP_ServerInit(ep, httpport))
|
while (!HTTP_ServerInit(ep, httpport))
|
||||||
sleep(5);
|
sleep(5);
|
||||||
PrepareStun(ep, httpport);
|
PrepareStun(ep, httpport);
|
||||||
|
|
|
@ -47,12 +47,6 @@
|
||||||
# define strnicmp strncasecmp
|
# define strnicmp strncasecmp
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
// Define these mostly for cod but could apply to other game tech
|
|
||||||
// Used this for guidance: https://github.com/xtnded/codextended - Brad
|
|
||||||
extern long xtn_LittleLong( long l );
|
|
||||||
extern short xtn_LittleShort( short s );
|
|
||||||
extern float xtn_LittleFloat( float f );
|
|
||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <stdarg.h>
|
#include <stdarg.h>
|
||||||
|
|
Loading…
Reference in a new issue