From 0c8cb64af72d47098558fb41099ba698c20401cc Mon Sep 17 00:00:00 2001 From: s1lentq Date: Sat, 7 Jan 2017 19:59:56 +0700 Subject: [PATCH] Fix #304 Fix unknown function __cpuidex when used in 3rd party --- rehlds/engine/host_cmd.cpp | 4 ---- rehlds/engine/sys_dll2.cpp | 4 ++++ rehlds/public/rehlds/sys_shared.cpp | 2 ++ 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/rehlds/engine/host_cmd.cpp b/rehlds/engine/host_cmd.cpp index 4bd29a1..3bf96c6 100644 --- a/rehlds/engine/host_cmd.cpp +++ b/rehlds/engine/host_cmd.cpp @@ -219,10 +219,6 @@ void Host_InitializeGameDLL(void) SV_CheckBlendingInterface(); SV_CheckSaveGameCommentInterface(); Cbuf_Execute(); - -#ifdef REHLDS_FIXES // DONE: Set cstrike flags on server start - SetCStrikeFlags(); -#endif } void Host_Motd_f(void) diff --git a/rehlds/engine/sys_dll2.cpp b/rehlds/engine/sys_dll2.cpp index 5427499..ca37d3c 100644 --- a/rehlds/engine/sys_dll2.cpp +++ b/rehlds/engine/sys_dll2.cpp @@ -699,6 +699,10 @@ bool CDedicatedServerAPI::Init_noVirt(char *basedir, char *cmdline, CreateInterf Q_snprintf(text, ARRAYSIZE(text), "exec %s\n", servercfgfile.string); text[255] = 0; Cbuf_InsertText(text); + +#ifdef REHLDS_FIXES + SetCStrikeFlags(); +#endif return true; } diff --git a/rehlds/public/rehlds/sys_shared.cpp b/rehlds/public/rehlds/sys_shared.cpp index 385b778..57e8eda 100644 --- a/rehlds/public/rehlds/sys_shared.cpp +++ b/rehlds/public/rehlds/sys_shared.cpp @@ -29,6 +29,8 @@ #if defined(__GNUC__) #include +#elif _MSC_VER >= 1400 && !defined(ASMLIB_H) +#include // __cpuidex #endif #define SSE3_FLAG (1<<0)