Skip to content

Commit

Permalink
Define fs alias in source file where used (#747)
Browse files Browse the repository at this point in the history
for filesystem namespace instead of relying on implicit include

Co-authored-by: Jan <[email protected]>
  • Loading branch information
GeckoEidechse and Jan200101 authored Jul 10, 2024
1 parent acdfefd commit 2cd7829
Show file tree
Hide file tree
Showing 10 changed files with 20 additions and 0 deletions.
2 changes: 2 additions & 0 deletions primedev/client/audio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <random>
#include <ranges>

namespace fs = std::filesystem;

AUTOHOOK_INIT()

static const char* pszAudioEventName;
Expand Down
2 changes: 2 additions & 0 deletions primedev/client/audio.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <regex>
#include <shared_mutex>

namespace fs = std::filesystem;

enum class AudioSelectionStrategy
{
INVALID = -1,
Expand Down
2 changes: 2 additions & 0 deletions primedev/client/languagehooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
#include <filesystem>
#include <regex>

namespace fs = std::filesystem;

AUTOHOOK_INIT()

typedef LANGID (*Tier0_DetectDefaultLanguageType)();
Expand Down
2 changes: 2 additions & 0 deletions primedev/core/hooks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@

#define XINPUT1_3_DLL "XInput1_3.dll"

namespace fs = std::filesystem;

AUTOHOOK_INIT()

// called from the ON_DLL_LOAD macros
Expand Down
2 changes: 2 additions & 0 deletions primedev/mods/autodownload/moddownloader.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
namespace fs = std::filesystem;

class ModDownloader
{
private:
Expand Down
2 changes: 2 additions & 0 deletions primedev/mods/modmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
#include <filesystem>
#include <unordered_set>

namespace fs = std::filesystem;

const std::string MOD_FOLDER_SUFFIX = "\\mods";
const std::string THUNDERSTORE_MOD_FOLDER_SUFFIX = "\\packages";
const std::string REMOTE_MOD_FOLDER_SUFFIX = "\\runtime\\remote\\mods";
Expand Down
2 changes: 2 additions & 0 deletions primedev/plugins/pluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "config/profile.h"
#include "core/convar/concommand.h"

namespace fs = std::filesystem;

PluginManager* g_pPluginManager;

const std::vector<Plugin>& PluginManager::GetLoadedPlugins() const
Expand Down
2 changes: 2 additions & 0 deletions primedev/plugins/pluginmanager.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@

#include <windows.h>

namespace fs = std::filesystem;

class Plugin;

class PluginManager
Expand Down
2 changes: 2 additions & 0 deletions primedev/server/buildainfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include <fstream>
#include <filesystem>

namespace fs = std::filesystem;

AUTOHOOK_INIT()

const int AINET_VERSION_NUMBER = 57;
Expand Down
2 changes: 2 additions & 0 deletions primedev/squirrel/squirrel.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#include "core/math/vector.h"
#include "mods/modmanager.h"

namespace fs = std::filesystem;

/*
definitions from hell
required to function
Expand Down

0 comments on commit 2cd7829

Please sign in to comment.