openvibers/source.openvibe.games Commits
Fix Windows server stub PCH include order
Changes
nnew file mode 100644@@@ -0,0 +1,15 @@++# Windows server stub PCH order++++Source SDK server projects compile with MSVC precompiled headers using `/Yu cbase.h`.++MSVC ignores/skips text before the configured PCH include, so the Windows server++QuickJS stub wrapper cannot put `#if ...` before `#include "cbase.h"`.++++The stubbed OpenVibe server `.cpp` files must start with:++++```cpp++#include "cbase.h"++// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB++#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)++```++++The non-stub branch must not re-include `cbase.h` immediately after `#else`.@@@ -1,7 +1,6 @@++#include "cbase.h"// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)----#include "cbase.h"#include "hl2mp_player.h"#include "openvibe_js_server.h"@@@ -82,7 +81,6 @@ static ConCommand ov_js_cmd(FCVAR_GAMEDLL);#else--#include "cbase.h"#include "hl2mp_player.h"#include "openvibe_js_server.h"#include "openvibe/ov_js_runtime.h"@@@ -1,14 +1,12 @@++#include "cbase.h"// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)----#include "cbase.h"#include "ov_js_bindings.h"#include "tier0/memdbgon.h"void OVJS_RegisterNativeBindings(JSContext *ctx, COpenVibeJSRuntime *runtime) {}#else--#include "cbase.h"#include "ov_js_bindings.h"#include "ov_js_runtime.h"#include "ov_js_player.h"@@@ -1,7 +1,6 @@++#include "cbase.h"// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)----#include "cbase.h"#include "ov_js_player.h"#include "hl2mp_player.h"@@@ -12,7 +11,6 @@ JSValue OVJS_NewPlayer(JSContext *ctx, CHL2MP_Player *player) { return JS_NULL;CHL2MP_Player *OVJS_ResolvePlayerByUserId(int userId) { return nullptr; }CHL2MP_Player *OVJS_GetPlayerFromThis(JSContext *ctx, JSValueConst thisVal) { return nullptr; }#else--#include "cbase.h"#include "hl2mp_player.h"#include "player.h"#include "util.h"@@@ -1,7 +1,6 @@++#include "cbase.h"// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)----#include "cbase.h"#include "ov_js_runtime.h"#include "tier0/memdbgon.h"@@@ -28,7 +27,6 @@ bool COpenVibeJSRuntime::CallHookBool(const char *pszHookName, bool *pOut, int areturn false;}#else--#include "cbase.h"#include "filesystem.h"#include "ov_js_runtime.h"#include "ov_js_bindings.h"
new file mode 100644
new file mode 100644
@@ -0,0 +1,15 @@
@@ -0,0 +1,15 @@
+# Windows server stub PCH order
+
+Source SDK server projects compile with MSVC precompiled headers using `/Yu cbase.h`.
+MSVC ignores/skips text before the configured PCH include, so the Windows server
+QuickJS stub wrapper cannot put `#if ...` before `#include "cbase.h"`.
+
+The stubbed OpenVibe server `.cpp` files must start with:
+
+```cpp
+#include "cbase.h"
+// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
+#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
+```
+
+The non-stub branch must not re-include `cbase.h` immediately after `#else`.
@@ -1,7 +1,6 @@
@@ -1,7 +1,6 @@
+#include "cbase.h"
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
-
-#include "cbase.h"
#include "hl2mp_player.h"
#include "hl2mp_player.h"
#include "openvibe_js_server.h"
#include "openvibe_js_server.h"
@@ -82,7 +81,6 @@ static ConCommand ov_js_cmd(
@@ -82,7 +81,6 @@ static ConCommand ov_js_cmd(
FCVAR_GAMEDLL
FCVAR_GAMEDLL
);
);
#else
#else
-#include "cbase.h"
#include "hl2mp_player.h"
#include "hl2mp_player.h"
#include "openvibe_js_server.h"
#include "openvibe_js_server.h"
#include "openvibe/ov_js_runtime.h"
#include "openvibe/ov_js_runtime.h"
@@ -1,14 +1,12 @@
@@ -1,14 +1,12 @@
+#include "cbase.h"
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
-
-#include "cbase.h"
#include "ov_js_bindings.h"
#include "ov_js_bindings.h"
#include "tier0/memdbgon.h"
#include "tier0/memdbgon.h"
void OVJS_RegisterNativeBindings(JSContext *ctx, COpenVibeJSRuntime *runtime) {}
void OVJS_RegisterNativeBindings(JSContext *ctx, COpenVibeJSRuntime *runtime) {}
#else
#else
-#include "cbase.h"
#include "ov_js_bindings.h"
#include "ov_js_bindings.h"
#include "ov_js_runtime.h"
#include "ov_js_runtime.h"
#include "ov_js_player.h"
#include "ov_js_player.h"
@@ -1,7 +1,6 @@
@@ -1,7 +1,6 @@
+#include "cbase.h"
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
-
-#include "cbase.h"
#include "ov_js_player.h"
#include "ov_js_player.h"
#include "hl2mp_player.h"
#include "hl2mp_player.h"
@@ -12,7 +11,6 @@ JSValue OVJS_NewPlayer(JSContext *ctx, CHL2MP_Player *player) { return JS_NULL;
@@ -12,7 +11,6 @@ JSValue OVJS_NewPlayer(JSContext *ctx, CHL2MP_Player *player) { return JS_NULL;
CHL2MP_Player *OVJS_ResolvePlayerByUserId(int userId) { return nullptr; }
CHL2MP_Player *OVJS_ResolvePlayerByUserId(int userId) { return nullptr; }
CHL2MP_Player *OVJS_GetPlayerFromThis(JSContext *ctx, JSValueConst thisVal) { return nullptr; }
CHL2MP_Player *OVJS_GetPlayerFromThis(JSContext *ctx, JSValueConst thisVal) { return nullptr; }
#else
#else
-#include "cbase.h"
#include "hl2mp_player.h"
#include "hl2mp_player.h"
#include "player.h"
#include "player.h"
#include "util.h"
#include "util.h"
@@ -1,7 +1,6 @@
@@ -1,7 +1,6 @@
+#include "cbase.h"
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
// OPENVIBE_WINDOWS_SERVER_QUICKJS_STUB
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
#if defined(_WIN32) && defined(GAME_DLL) && !defined(OPENVIBE_WINDOWS_SERVER_REAL_QUICKJS)
-
-#include "cbase.h"
#include "ov_js_runtime.h"
#include "ov_js_runtime.h"
#include "tier0/memdbgon.h"
#include "tier0/memdbgon.h"
@@ -28,7 +27,6 @@ bool COpenVibeJSRuntime::CallHookBool(const char *pszHookName, bool *pOut, int a
@@ -28,7 +27,6 @@ bool COpenVibeJSRuntime::CallHookBool(const char *pszHookName, bool *pOut, int a
return false;
return false;
}
}
#else
#else
-#include "cbase.h"
#include "filesystem.h"
#include "filesystem.h"
#include "ov_js_runtime.h"
#include "ov_js_runtime.h"
#include "ov_js_bindings.h"
#include "ov_js_bindings.h"