25#include "../common/bothdefs.h"
29#define MSVC_LINE __FILE__"("STRINGIFY(__LINE__)"):"
30#define warningmsg(s) message(MSVC_LINE s)
32#define warningmsg(s) message(s)
35#ifdef MSVCDISABLEWARNINGS
46#pragma warning( 4 : 4244)
47#pragma warning( 4 : 4305)
48#pragma warning( 4 : 4018)
50#pragma warning( 2 : 4701)
51#pragma warning(2:4132 4268)
53#pragma warning(2:4032)
54#pragma warning(2:4092)
55#pragma warning(2:4132 4268)
57#pragma warning(2:4239)
58#pragma warning(2:4701)
60#pragma warning(2:4709)
61#pragma warning(3:4061)
62#pragma warning(3:4710)
63#pragma warning(3:4121)
64#pragma warning(3:4505)
65#pragma warning(3:4019)
67#pragma warning(3:4125)
68#pragma warning(2:4131)
69#pragma warning(3:4211)
71#pragma warning(3:4222)
72#pragma warning(3:4234 4235)
73#pragma warning(3:4504)
74#pragma warning(3:4507)
75#pragma warning(3:4515)
76#pragma warning(3:4516 4517)
77#pragma warning(3:4670)
78#pragma warning(3:4671)
79#pragma warning(3:4673)
80#pragma warning(3:4674)
81#pragma warning(3:4705)
83#pragma warning(3:4013)
86#pragma warning( 4 : 4267)
87#pragma warning( 4 : 4710)
89#pragma warning( error : 4020)
91#pragma warning(error:4013)
94#define _CRT_SECURE_NO_DEPRECATE
95#define _CRT_NONSTDC_NO_DEPRECATE
103#define PNG_SUCKS_WITH_SETJMP
114#if defined(AVAIL_PNGLIB) && defined(PNG_SUCKS_WITH_SETJMP) && !defined(SERVERONLY)
116 #include "./mingw-libs/png.h"
117 #elif defined(_WIN32)
123 #ifdef FTE_TARGET_WEB
127 #define setjmp(x) (x=0,x)
128 #define longjmp(b,r) emscriptenfte_abortmainloop(__func__, false)
136#ifdef USE_MSVCRT_DEBUG
137 #define _CRTDBG_MAP_ALLOC
140#if defined(_WIN32) || defined(__DJGPP__)
142#elif !defined(alloca)
150 #define stat stat_nolink
151 #define fopen fopen_nolink
152 #define fread fread_nolink
153 #define fwrite fwrite_nolink
154 #define fclose fclose_nolink
155 #define fseek fseek_nolink
156 #define open open_nolink
157 #define read read_nolink
158 #define write write_nolink
159 #define close close_nolink
166#include "../common/common.h"
167#include "../common/bspfile.h"
169#include "../common/sys.h"
170#include "../common/zone.h"
171#include "../common/mathlib.h"
172#include "../common/cvar.h"
173#include "../common/translate.h"
174#include "../common/net.h"
176#include "../common/protocol.h"
177#include "../common/cmd.h"
178#include "../common/console.h"
186#include "../gl/gl_model.h"
188#include "../common/vm.h"
195#include "../common/pmove.h"
197#include "../qclib/progtype.h"
198#include "../server/progdefs.h"
199#include "../server/progs.h"
200#include "../common/world.h"
201#include "../server/q2game.h"
202#include "../http/iweb.h"
204#define SSV_IsSubServer() false
206#include "../server/server.h"
210#if defined(Q3CLIENT) || defined(Q3SERVER)
215 #define q_max(a,b) ((a) > (b) ? (a) : (b))
216 #define q_min(a,b) ((a) < (b) ? (a) : (b))
219 #define max(a,b) ((a) > (b) ? (a) : (b))
220 #define min(a,b) ((a) < (b) ? (a) : (b))
222 #define max3(a,b,c) max(max(a,b),c)
228 #include <inttypes.h>
232 #define PRIx64 "I64x"
233 #define PRIu64 "I64u"
234 #define PRIi64 "I64i"
238 #define PRIxSIZE PRIx64
239 #define PRIuSIZE PRIu64
240 #define PRIiSIZE PRIi64
248 #include <inttypes.h>
250 #if FTE_WORDSIZE != 32 || __STDC_VERSION__ >= 199901L || defined(__GNUC__)
252 #define PRIxSIZE "zx"
253 #define PRIuSIZE "zu"
254 #define PRIiSIZE "zi"
257 #define PRIxSIZE PRIxPTR
258 #define PRIuSIZE PRIuPTR
259 #define PRIiSIZE PRIiPTR
265 #if (_MSC_VER >= 1900)
267 #elif (_MSC_VER >= 1400)
269 #define snprintf (void)linuxlike_snprintf_vc8
271 #define vsnprintf(a, b, c, d) (void)(vsnprintf_s(a, b, _TRUNCATE, c, d))
274 #define snprintf (void)linuxlike_snprintf
276 #define vsnprintf (void)linuxlike_vsnprintf
287 #define strcasecmp _stricmp
290 #define strncasecmp _strnicmp
313#define MAX_NUM_ARGVS 128
369#define COM_MainThreadWork() while (COM_DoWork(0, false) && worker_flush.ival)
370#define COM_MainThreadFlush() while (COM_DoWork(0, false))
384#define COM_AssertMainThread(msg)
387#define com_workererror false
388#define COM_AddWork(t,f,a,b,c,d) (f)((a),(b),(c),(d))
389#define COM_InsertWork(t,f,a,b,c,d) (f)((a),(b),(c),(d))
390#define COM_WorkerPartialSync(c,a,v)
391#define COM_WorkerFullSync()
392#define COM_WorkerLock()
393#define COM_WorkerUnlock()
394#define COM_HasWork() false
395#define COM_DoWork(t,l) false
396#define COM_AssertMainThread(msg)
397#define COM_MainThreadWork() while(0)
398#define COM_MainThreadFlush()
399#define COM_DestroyWorkerThread()
400#define COM_WorkerAbort(m)
407#define isDedicated true
408#elif !defined(HAVE_SERVER)
409#define isDedicated false
double time
Definition: cl_main.c:306
cvar_t msg
Definition: cl_main.c:159
unsigned char qbyte
Definition: common.h:127
GLenum GLuint GLenum GLsizei const GLchar * message
Definition: gl_vidcommon.c:351
static EGLSurface EGLSurface EGLContext ctx
Definition: gl_videgl.c:47
int error
Definition: gl_vidlinuxglx.c:447
GLint size
Definition: glquake.h:157
GLsizei GLboolean const GLfloat * value
Definition: glquake.h:164
GLenum format
Definition: glsupp.h:502
GLint GLfloat * parms
Definition: glsupp.h:612
char fname[MAX_QPATH]
Definition: m_mp3.c:160
char ** data
Definition: p_script.c:63
int b
Definition: pr_lua.c:242
const char * file
Definition: qcc_pr_lex.c:2518
void Host_ServerFrame(void)
qboolean COM_DoWork(int thread, qboolean leavelocked)
Definition: common.c:6076
cvar_t developer
Definition: common.c:72
cvar_t com_parseutf8
Definition: common.c:87
cvar_t host_mapname
Definition: common.c:91
cvar_t com_gamedirnativecode
Definition: common.c:89
quakeparms_t host_parms
Definition: common.c:32
void COM_WorkerUnlock(void)
Definition: common.c:6308
double host_frametime
Definition: common.c:29
qboolean com_workererror
Definition: common.c:5963
cvar_t fs_gamename
Definition: common.c:84
void Host_Init(quakeparms_t *parms)
Definition: cl_main.c:7441
void Host_Shutdown(void)
Definition: cl_main.c:7571
void COM_AddWork(wgroup_t thread, void(*func)(void *ctx, void *data, size_t a, size_t b), void *ctx, void *data, size_t a, size_t b)
Definition: common.c:6018
qboolean wantquit
Definition: common.c:104
qboolean COM_HasWork(void)
Definition: common.c:5974
void COM_WorkerFullSync(void)
Definition: common.c:6326
void COM_InsertWork(wgroup_t tg, void(*func)(void *ctx, void *data, size_t a, size_t b), void *ctx, void *data, size_t a, size_t b)
Definition: common.c:5984
cvar_t sys_nostdout
Definition: sv_sys_unix.c:66
void COM_DestroyWorkerThread(void)
Definition: common.c:6250
double realtime
Definition: common.c:30
qbyte * host_basepal
Definition: cl_main.c:332
cvar_t password
Definition: cl_main.c:148
qbyte * h2playertranslations
Definition: cl_main.c:333
int VARGS linuxlike_vsnprintf(char *buffer, int size, const char *format, va_list argptr)
Definition: sys_plugfte.c:212
void VARGS Host_ClientCommands(char *fmt,...) LIKEPRINTF(1)
void COM_WorkerPartialSync(void *priorityctx, int *address, int value)
Definition: common.c:6388
cvar_t ezcompat_markup
Definition: common.c:93
cvar_t scr_usekfont
Definition: common.c:95
NORETURN void VARGS Host_Error(const char *error,...) LIKEPRINTF(1)
Definition: cl_main.c:5763
void Host_FinishInit(void)
void * com_resourcemutex
Definition: common.c:5948
struct quakeparms_s quakeparms_t
cvar_t com_protocolname
Definition: common.c:85
int jmp_buf
Definition: quakedef.h:129
qboolean Host_RunFile(const char *fname, int nlen, vfsfile_t *file)
Definition: cl_main.c:6505
NORETURN void VARGS Host_EndGame(const char *message,...) LIKEPRINTF(1)
Definition: cl_main.c:5728
void COM_AssertMainThread(const char *msg)
Definition: common.c:6242
qboolean msg_suppress_1
Definition: common.c:102
qboolean Host_SimulationTime(float time)
Definition: cl_main.c:5841
cvar_t pkg_autoupdate
Definition: m_download.c:35
cvar_t worker_flush
Definition: common.c:5942
void Host_InitCommands(void)
qboolean host_initialized
Definition: common.c:31
void COM_WorkerLock(void)
Definition: common.c:6281
int VARGS linuxlike_snprintf(char *buffer, int size, const char *format,...) LIKEPRINTF(3)
Definition: sys_plugfte.c:193
void Host_ShutdownServer(qboolean crash)
double Host_Frame(double time)
Definition: cl_main.c:6651
cvar_t com_protocolversion
Definition: common.c:86
qboolean noclip_anglehack
Definition: cl_main.c:45
void COM_WorkerAbort(char *message)
Definition: common.c:6215
int VARGS linuxlike_snprintf_vc8(char *buffer, int size, const char *format,...) LIKEPRINTF(3)
Definition: sys_plugfte.c:228
int host_framecount
Definition: cl_main.c:330
qboolean isDedicated
Definition: sys_droid.c:26
uploadfmt_t fmt
Definition: r_2d.c:48
static ALC_API ALCvoid * buffer
Definition: snd_al.c:259
Definition: quakedef.h:302
const char * basedir
Definition: quakedef.h:303
const char * manifest
Definition: quakedef.h:305
int argc
Definition: quakedef.h:306
const char ** argv
Definition: quakedef.h:307
const char * binarydir
Definition: quakedef.h:304
netadr_t a
Definition: sv_master.c:141
void * vfsfile_t
Definition: sys_plugfte.h:2