From 6c7220324ed29b5a2afb3e4bb2fd214ce9cd40dd Mon Sep 17 00:00:00 2001 From: Spoike Date: Thu, 27 Jun 2019 14:38:51 +0000 Subject: [PATCH] Fix some compile issues. git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@5483 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/common/bothdefs.h | 9 +++++++++ engine/common/fs.c | 4 ++-- engine/server/sv_main.c | 2 +- engine/server/sv_user.c | 2 ++ 4 files changed, 14 insertions(+), 3 deletions(-) diff --git a/engine/common/bothdefs.h b/engine/common/bothdefs.h index 614937a02..68d951087 100644 --- a/engine/common/bothdefs.h +++ b/engine/common/bothdefs.h @@ -722,6 +722,15 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. #define FTE_ALIGN(a) #endif +#if __STDC_VERSION__ >= 201112L + #include + #define fte_alignof(type) alignof(qintptr_t) +#elif _MSC_VER + #define fte_alignof(type) __alignof(qintptr_t) +#else + #define fte_alignof(type) sizeof(qintptr_t) +#endif + //fte_inline must only be used in headers, and requires one and ONLY one fte_inlinebody elsewhere. //fte_inlinebody must be used on a prototype OUTSIDE of a header. //fte_inlinestatic must not be used inside any headers at all. diff --git a/engine/common/fs.c b/engine/common/fs.c index 1cb3158f6..779acc4c9 100644 --- a/engine/common/fs.c +++ b/engine/common/fs.c @@ -1069,7 +1069,7 @@ static void QDECL FS_AddFileHash(int depth, const char *fname, fsbucket_t *fileh { int nlen = strlen(fname)+1; int plen = sizeof(*filehandle)+nlen; - plen = (plen+__alignof(*filehandle)-1) & ~(__alignof(*filehandle)-1); + plen = (plen+fte_alignof(fsbucket_t)-1) & ~(fte_alignof(fsbucket_t)-1); if (!fs_hash_filebuckets || fs_hash_filebuckets->used+plen > fs_hash_filebuckets->total) { void *o = fs_hash_filebuckets; @@ -3155,7 +3155,7 @@ void COM_Gamedir (const char *dir, const struct gamepacks *packagespaths) #define EZQUAKECOMPETITIVE "set ruleset_allow_fbmodels 1\nset sv_demoExtensions \"\"\n" /*quake requires a few settings for compatibility*/ #define QRPCOMPAT "set cl_cursor_scale 0.2\nset cl_cursor_bias_x 7.5\nset cl_cursor_bias_y 0.8" -#define QCFG "set v_gammainverted 1\nset con_stayhidden 0\nset com_parseutf8 0\nset allow_download_refpackages 0\nset sv_bigcoords \"\"\nmap_autoopenportals 1\n" "sv_port "STRINGIFY(PORT_QWSERVER)" "STRINGIFY(PORT_NQSERVER)"\n" ZFIXHACK EZQUAKECOMPETITIVE QRPCOMPAT +#define QCFG "set v_gammainverted 1\nset con_stayhidden 0\nset com_parseutf8 0\nset allow_download_pakcontents 1\nset allow_download_refpackages 0\nset sv_bigcoords \"\"\nmap_autoopenportals 1\n" "sv_port "STRINGIFY(PORT_QWSERVER)" "STRINGIFY(PORT_NQSERVER)"\n" ZFIXHACK EZQUAKECOMPETITIVE QRPCOMPAT /*NetQuake reconfiguration, to make certain people feel more at home...*/ #define NQCFG "//-nohome\ncfg_save_auto 1\n" QCFG "sv_nqplayerphysics 1\ncl_loopbackprotocol auto\ncl_sbar 1\nplug_sbar 0\nsv_port "STRINGIFY(PORT_NQSERVER)"\ncl_defaultport "STRINGIFY(PORT_NQSERVER)"\n" //nehahra has to be weird with its extra cvars, and buggy fullbrights. diff --git a/engine/server/sv_main.c b/engine/server/sv_main.c index deb824154..13129ad9e 100644 --- a/engine/server/sv_main.c +++ b/engine/server/sv_main.c @@ -92,7 +92,7 @@ cvar_t allow_download_demos = CVARD("allow_download_demos", "1", "0 blocks down cvar_t allow_download_maps = CVARD("allow_download_maps", "1", "0 blocks downloading of any file in the maps/ directory"); cvar_t allow_download_logs = CVARD("allow_download_logs", "0", "1 permits downloading files with the extension .log\n"CON_ERROR"THIS IS DANGEROUS AS IT POTENTIALLY ALLOWS PEOPLE TO SEE PASSWORDS OR OTHER PRIVATE INFORMATION.\nNote that it can be switch on/off via rcon."); cvar_t allow_download_anymap = CVARD("allow_download_pakmaps", "0", "If 1, permits downloading of maps from within packages. This is normally disabled in order to prevent copyrighted content from being downloaded."); -cvar_t allow_download_pakcontents = CVARD("allow_download_pakcontents", "1", "controls whether clients connected to this server are allowed to download files from within packages.\nDoes NOT implicitly allow downloading bsps, set allow_download_pakmaps to enable that.\nWhile treating each file contained within packages is often undesirable, this is often needed for compatibility with legacy clients (despite it potentially allowing copyright violations)."); +cvar_t allow_download_pakcontents = CVARD("allow_download_pakcontents", "0", "controls whether clients connected to this server are allowed to download files from within packages.\nDoes NOT implicitly allow downloading bsps, set allow_download_pakmaps to enable that.\nWhile treating each file contained within packages is often undesirable, this is often needed for compatibility with legacy clients (despite it potentially allowing copyright violations)."); cvar_t allow_download_root = CVARD("allow_download_root", "0", "If set, enables downloading from the root of the gamedir (not the basedir). This setting has a lower priority than extension-based checks."); cvar_t allow_download_textures = CVARD("allow_download_textures", "1", "0 blocks downloading of any file in the textures/ directory"); cvar_t allow_download_packages = CVARD("allow_download_packages", "1", "if 1, permits downloading files (from root directory or elsewhere) with known package extensions (eg: pak+pk3). Packages with a name starting 'pak' are covered by allow_download_copyrighted as well."); diff --git a/engine/server/sv_user.c b/engine/server/sv_user.c index cb487faa2..fdca76094 100644 --- a/engine/server/sv_user.c +++ b/engine/server/sv_user.c @@ -3368,7 +3368,9 @@ void SV_DemoDownload_f(void) if (host_client->download) VFS_CLOSE (host_client->download); host_client->download = NULL; +#ifdef NQPROT host_client->downloadstarted = false; +#endif } #ifdef HAVE_LEGACY SV_DownloadQueueClear(host_client);