Force-include `pch.h` to all files, remove explicit includes (#393)

* force-include "pch.h" in all units, as it will error if it's not included anyways

* remove #include "pch.h" from all files as it's not needed anymore now

* fix size of NSUserAgent to be consistent (it's 256 in version.cpp, caused compile error)

* Re-add explicit pch.h include to pch.cpp (and ran clang-format)

* drop pch.h inclusion from new files
This commit is contained in:
p0358 2023-02-14 15:04:42 +01:00 committed by GitHub
parent 95b41b6f8c
commit 9b1e2a0f48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
89 changed files with 3 additions and 91 deletions

View File

@ -63,6 +63,7 @@
<PrecompiledHeaderFile>pch.h</PrecompiledHeaderFile>
<LanguageStandard>stdcpp20</LanguageStandard>
<AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>
@ -95,6 +96,7 @@
<AdditionalIncludeDirectories>$(ProjectDir);$(SolutionDir)include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<Optimization>Disabled</Optimization>
<ForcedIncludeFiles>pch.h</ForcedIncludeFiles>
</ClCompile>
<Link>
<SubSystem>Windows</SubSystem>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "audio.h"
#include "dedicated/dedicated.h"
#include "core/convar/convar.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
#include "core/convar/concommand.h"
#include "localchatwriter.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "masterserver/masterserver.h"
#include "core/convar/convar.h"
#include "client/r2client.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "dedicated/dedicated.h"
#include "core/convar/cvar.h"
#include "core/math/vector.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
ON_DLL_LOAD_CLIENT("engine.dll", EngineDemoFixes, (CModule module))

View File

@ -1,4 +1,3 @@
#include "pch.h"
ON_DLL_LOAD_CLIENT("materialsystem_dx11.dll", DiskVMTFixes, (CModule module))
{

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/tier0.h"
#include <filesystem>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "localchatwriter.h"
class vgui_BaseRichText_vtable;

View File

@ -1,5 +1,4 @@
#pragma once
#include "pch.h"
#include "core/math/color.h"
class vgui_BaseRichText;

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "r2client.h"
using namespace R2;

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "engine/r2engine.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "config/profile.h"
#include "dedicated/dedicated.h"
#include <string>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "concommand.h"
#include "shared/misccommands.h"
#include "engine/r2engine.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "bits.h"
#include "cvar.h"
#include "convar.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "cvar.h"
#include "convar.h"
#include "concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "filesystem.h"
#include "core/sourceinterface.h"
#include "mods/modmanager.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "rpakfilesystem.h"
#include "mods/modmanager.h"
#include "dedicated/dedicated.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "dedicated/dedicated.h"
#include <iostream>

View File

@ -4,7 +4,6 @@
//
//=============================================================================//
#include "pch.h"
#include "bits.h"
//-----------------------------------------------------------------------------

View File

@ -1,4 +1,3 @@
#include "pch.h"
// clang-format off
namespace NS::Colors

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/memalloc.h"
#include "core/tier0.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "memory.h"
MemoryAddress::MemoryAddress() : m_nAddress(0) {}

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "sourceinterface.h"
#include "logging/sourceconsole.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "tier0.h"
// use the Tier0 namespace for tier0 funcs

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "dedicated.h"
#include "core/tier0.h"
#include "playlist.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "dedicated.h"
#include "core/tier0.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "dllmain.h"
#include "logging/logging.h"
#include "logging/crashhandler.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
#include "mods/modmanager.h"
#include "util/printcommands.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "engine/hoststate.h"
#include "masterserver/masterserver.h"
#include "server/auth/serverauthentication.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "r2engine.h"
using namespace R2;

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "engine/r2engine.h"
#include "server/r2server.h"
#include "hoststate.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "crashhandler.h"
#include "dedicated/dedicated.h"
#include "config/profile.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "logging.h"
#include "core/convar/convar.h"
#include "core/convar/concommand.h"

View File

@ -1,5 +1,4 @@
#pragma once
#include "pch.h"
#include "spdlog/sinks/base_sink.h"
#include "spdlog/logger.h"
#include "squirrel/squirrel.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "logging.h"
#include "loghooks.h"
#include "core/convar/convar.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
#include "sourceconsole.h"
#include "core/sourceinterface.h"

View File

@ -1,5 +1,4 @@
#pragma once
#include "pch.h"
#include "core/sourceinterface.h"
#include "spdlog/sinks/base_sink.h"
#include <map>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "masterserver/masterserver.h"
#include "core/convar/concommand.h"
#include "playlist.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
#include "core/filesystem/filesystem.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
#include "core/filesystem/filesystem.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
#include "core/filesystem/filesystem.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
#include "core/filesystem/filesystem.h"
#include "squirrel/squirrel.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "modmanager.h"
#include "core/convar/convar.h"
#include "core/convar/concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "plugins.h"
#include "masterserver/masterserver.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "util/utils.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "util/wininfo.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "masterserver/masterserver.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "mods/modmanager.h"
#include "squirrel/squirrel.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "masterserver/masterserver.h"
#include "server/auth/serverauthentication.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "core/convar/convar.h"
#include "core/convar/concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "core/filesystem/rpakfilesystem.h"
#include "core/convar/convar.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "scripthttprequesthandler.h"
#include "util/version.h"
#include "squirrel/squirrel.h"

View File

@ -1,7 +1,5 @@
#pragma once
#include "pch.h"
enum class ScriptContext;
// These definitions below should match on the Squirrel side so we can easily pass them along through a function.

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "rapidjson/error/en.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "client/r2client.h"
#include "engine/r2engine.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
ON_DLL_LOAD("server.dll", MiscServerFixes, (CModule module))
{

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "masterserver/masterserver.h"
#include "server/auth/serverauthentication.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel/squirrel.h"
#include "engine/r2engine.h"
#include "server/r2server.h"

View File

@ -1,5 +1,4 @@
#pragma once
#include "pch.h"
#include "bansystem.h"
#include "serverauthentication.h"
#include "core/convar/concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "serverauthentication.h"
#include "shared/exploit_fixes/ns_limits.h"
#include "core/convar/cvar.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/convar.h"
#include "engine/hoststate.h"
#include "engine/r2engine.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "r2server.h"
using namespace R2;

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "serverchathooks.h"
#include "shared/exploit_fixes/ns_limits.h"
#include "squirrel/squirrel.h"

View File

@ -1,5 +1,4 @@
#pragma once
#include "pch.h"
#include <rapidjson/document.h>
#include <rapidjson/stringbuffer.h>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "serverpresence.h"
#include "shared/playlist.h"
#include "core/tier0.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/convar/cvar.h"
#include "ns_limits.h"
#include "dedicated/dedicated.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
AUTOHOOK_INIT()

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "ns_limits.h"
#include "engine/hoststate.h"
#include "client/r2client.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "keyvalues.h"
#include <winnt.h>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "core/tier0.h"
#include "maxplayers.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "misccommands.h"
#include "core/convar/concommand.h"
#include "shared/playlist.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "playlist.h"
#include "core/convar/concommand.h"
#include "core/convar/convar.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrel.h"
#include "logging/logging.h"
#include "core/convar/concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "squirrelautobind.h"
SquirrelAutoBindContainer* g_pSqAutoBindContainer;

View File

@ -1,5 +1,4 @@
#pragma once
#include "pch.h"
#include "squirreldatatypes.h"
#include <queue>

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "printcommands.h"
#include "core/convar/convar.h"
#include "core/convar/concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include "printmaps.h"
#include "core/convar/convar.h"
#include "core/convar/concommand.h"

View File

@ -1,4 +1,3 @@
#include "pch.h"
#include <ctype.h>
#include "utils.h"

View File

@ -1,5 +1,4 @@
#include "util/version.h"
#include "pch.h"
#include "ns_version.h"
#include "dedicated/dedicated.h"

View File

@ -1,6 +1,6 @@
#pragma once
extern char version[16];
extern char NSUserAgent[32];
extern char NSUserAgent[256];
void InitialiseVersion();

View File

@ -1,5 +1,3 @@
#include "pch.h"
AUTOHOOK_INIT()
HWND* g_gameHWND;

View File

@ -1,6 +1,4 @@
#pragma once
#pragma once
#include "pch.h"
extern HWND* g_gameHWND;
extern HMODULE g_NorthstarModule;