diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 85ced4e54..28f48cdad 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -247,6 +247,9 @@ set(SRB2_CONFIG_ASAN OFF CACHE BOOL set(SRB2_CONFIG_UBSAN OFF CACHE BOOL "Compile with UndefinedBehaviorSanitizer (libubsan).") +set(SRB2_CONFIG_MUMBLE ON CACHE BOOL + "Enable Mumble support") + set(SRB2_CONFIG_SATURNPAK ON CACHE BOOL "Enable Saturn specific special packet. Required for using the newer resynch system") set(SRB2_CONFIG_SATURNJOIN ON CACHE BOOL diff --git a/src/Makefile b/src/Makefile index 4ee7cf1a9..5b1f9f0fa 100644 --- a/src/Makefile +++ b/src/Makefile @@ -246,10 +246,6 @@ ifdef STATIC libs+=-static endif -ifneq (,$(filter $(CC) $(CXX),gcc g++)) - opts+=-mno-ms-bitfields -endif - # build with profiling information ifdef PROFILEMODE opts+=-pg diff --git a/src/Makefile.d/features.mk b/src/Makefile.d/features.mk index 410077939..af67a5494 100644 --- a/src/Makefile.d/features.mk +++ b/src/Makefile.d/features.mk @@ -86,7 +86,7 @@ ifdef VALGRIND VALGRIND_PKGCONFIG?=valgrind VALGRIND_LDFLAGS= $(eval $(call Use_pkg_config,VALGRIND)) -ZDEBUG=1 +#ZDEBUG=1 we enable this by default opts+=-DHAVE_VALGRIND endif diff --git a/src/d_netfil.c b/src/d_netfil.c index 944d9560b..613b72df5 100644 --- a/src/d_netfil.c +++ b/src/d_netfil.c @@ -1616,8 +1616,7 @@ static void CURLGetFile(void) #endif } -HTTP_login * -CURLGetLogin (const char *url, HTTP_login ***return_prev_next) +HTTP_login *CURLGetLogin(const char *url, HTTP_login ***return_prev_next) { HTTP_login * login; HTTP_login ** prev_next; @@ -1627,7 +1626,7 @@ CURLGetLogin (const char *url, HTTP_login ***return_prev_next) ( login = (*prev_next)); prev_next = &login->next ){ - if (fastcmp(login->url, url) != 0) + if (fastcmp(login->url, url)) { if (return_prev_next) (*return_prev_next) = prev_next; diff --git a/src/d_protocol.c b/src/d_protocol.c index 963d8e587..7cf84be93 100644 --- a/src/d_protocol.c +++ b/src/d_protocol.c @@ -211,12 +211,12 @@ void D_SetupProtocol(void) if (result) { - if (!fastcmp(buffer, "no")) + if (fastcmp(buffer, "no")) { fclose(fp); return; } - else if (fastcmp(buffer, exe_path)) + else if (!fastcmp(buffer, exe_path)) { // overwrite fclose(fp); diff --git a/src/hardware/hw_main.cpp b/src/hardware/hw_main.cpp index 562be50bb..907f80cf0 100644 --- a/src/hardware/hw_main.cpp +++ b/src/hardware/hw_main.cpp @@ -1101,8 +1101,8 @@ static void HWR_SplitWall(sector_t *sector, FOutVector *wallVerts, INT32 texnum, // Found a break // The heights are clamped to ensure the polygon doesn't cross itself. - bot = std::clamp(bheight, realbot, top); - endbot = std::clamp(endbheight, endrealbot, endtop); + bot = std::min(std::max(bheight, realbot), top); + endbot = std::min(std::max(endbheight, endrealbot), endtop); Surf->PolyColor.s.alpha = alpha; diff --git a/src/lua_hooklib.c b/src/lua_hooklib.c index fe997123b..82c1a00d6 100644 --- a/src/lua_hooklib.c +++ b/src/lua_hooklib.c @@ -584,7 +584,6 @@ FUNCINLINE static ATTRINLINE int call_mobj_type_hooks(Hook_State *hook, mobjtype || hook->hook_type == MOBJ_HOOK(MobjCollide ) || hook->hook_type == MOBJ_HOOK(MobjMoveCollide) || hook->hook_type == MOBJ_HOOK(MobjFuse ) - || hook->hook_type == MOBJ_HOOK(MobjThinker ) || hook->hook_type == MOBJ_HOOK(BossThinker ) )) { @@ -1062,6 +1061,9 @@ void LUA_HookNetArchive(lua_CFunction archFunc, savebuffer_t *save) lua_pushcclosure(gL, archFunc, 2); // stack: tables, savebuffer_t, archFunc + // Manually set the hook's variables here since we don't call prepare_hook + hook.hook_type = HOOK(NetVars); + hook.mobj_type = NONMOHOOK; // Force mobj_type to be NONMOHOOK so the mobj_type check get skipped init_hook_call(&hook, 0, res_none); call_mapped(&hook, map); diff --git a/src/m_curl.c b/src/m_curl.c index 77588a3fb..f7ff29955 100644 --- a/src/m_curl.c +++ b/src/m_curl.c @@ -11,7 +11,7 @@ #include "m_curl.h" #include "doomtype.h" -#include "i_system.h" // I_OutputMsg +#include "doomdef.h" // I_OutputMsg #include "m_argv.h" // M_CheckParm, M_GetNextParm static boolean curl_args_init = false; diff --git a/src/sdl/CMakeLists.txt b/src/sdl/CMakeLists.txt index c7d612c80..13b41323e 100644 --- a/src/sdl/CMakeLists.txt +++ b/src/sdl/CMakeLists.txt @@ -243,6 +243,10 @@ if(${SDL2_FOUND}) target_link_options(SRB2SDL2 PRIVATE -fsanitize=undefined) endif() + if(NOT SRB2_CONFIG_MUMBLE) + target_compile_options(SRB2SDL2 PRIVATE -DNOMUMBLE) + endif() + ## strip debug symbols into separate file when using gcc # if(CMAKE_COMPILER_IS_GNUCC) # if(${CMAKE_BUILD_TYPE} MATCHES Debug) diff --git a/src/sdl/i_system.cpp b/src/sdl/i_system.cpp index dd3508efd..48ba6a21e 100644 --- a/src/sdl/i_system.cpp +++ b/src/sdl/i_system.cpp @@ -1405,7 +1405,11 @@ void I_SleepDuration(precise_t duration) duration -= slack; struct timespec ts = { .tv_sec = static_cast<__time_t>(duration / precision), +#ifdef __BIONIC__ + .tv_nsec = static_cast(duration * 1000000000 / precision % 1000000000), +#else .tv_nsec = static_cast<__syscall_slong_t>(duration * 1000000000 / precision % 1000000000), +#endif }; int status; do status = clock_nanosleep(CLOCK_MONOTONIC, 0, &ts, &ts);