Skip to content

Commit

Permalink
Move all system & boost headers to PCH (#4022)
Browse files Browse the repository at this point in the history
  • Loading branch information
ranisalt committed Mar 18, 2022
1 parent 92b35aa commit f80456e
Show file tree
Hide file tree
Showing 23 changed files with 25 additions and 51 deletions.
3 changes: 0 additions & 3 deletions src/combat.h
Expand Up @@ -8,9 +8,6 @@
#include "condition.h"
#include "item.h"

#include <utility>
#include <valarray>

class Creature;
class Player;
struct Position;
Expand Down
2 changes: 0 additions & 2 deletions src/condition.h
Expand Up @@ -6,8 +6,6 @@

#include "enums.h"

#include <limits>

class Creature;
class Player;
class PropStream;
Expand Down
2 changes: 0 additions & 2 deletions src/database.h
Expand Up @@ -6,8 +6,6 @@

#include "pugicast.h"

#include <mysql/mysql.h>

class DBResult;
using DBResult_ptr = std::shared_ptr<DBResult>;

Expand Down
2 changes: 0 additions & 2 deletions src/databasetasks.h
Expand Up @@ -7,8 +7,6 @@
#include "database.h"
#include "thread_holder_base.h"

#include <condition_variable>

struct DatabaseTask {
DatabaseTask(std::string&& query, std::function<void(DBResult_ptr, bool)>&& callback, bool store) :
query(std::move(query)), callback(std::move(callback)), store(store) {}
Expand Down
2 changes: 0 additions & 2 deletions src/definitions.h
Expand Up @@ -27,8 +27,6 @@ static constexpr auto AUTHENTICATOR_PERIOD = 30U;
#define _USE_MATH_DEFINES
#endif

#include <cmath>

#ifdef _WIN32
#ifndef NOMINMAX
#define NOMINMAX
Expand Down
3 changes: 0 additions & 3 deletions src/fileloader.h
Expand Up @@ -4,9 +4,6 @@
#ifndef FS_FILELOADER_H
#define FS_FILELOADER_H

#include <boost/iostreams/device/mapped_file.hpp>
#include <limits>

class PropStream;

namespace OTB {
Expand Down
3 changes: 0 additions & 3 deletions src/item.h
Expand Up @@ -10,9 +10,6 @@
#include "thing.h"
#include "tools.h"

#include <boost/variant.hpp>
#include <deque>

class BedItem;
class Container;
class Door;
Expand Down
2 changes: 0 additions & 2 deletions src/lockfree.h
Expand Up @@ -8,8 +8,6 @@
#define _ENABLE_ATOMIC_ALIGNMENT_FIX
#endif

#include <boost/lockfree/stack.hpp>

/*
* we use this to avoid instantiating multiple free lists for objects of the
* same size and it can be replaced by a variable template in C++14
Expand Down
8 changes: 0 additions & 8 deletions src/luascript.h
Expand Up @@ -8,14 +8,6 @@
#include "enums.h"
#include "position.h"

#include <cassert>

#if __has_include("luajit/lua.hpp")
#include <luajit/lua.hpp>
#else
#include <lua.hpp>
#endif

#if LUA_VERSION_NUM >= 502
#ifndef LUA_COMPAT_ALL
#ifndef LUA_COMPAT_MODULE
Expand Down
2 changes: 0 additions & 2 deletions src/luavariant.h
@@ -1,8 +1,6 @@
#ifndef FS_LUAVARIANT_H
#define FS_LUAVARIANT_H

#include <variant>

enum LuaVariantType_t {
VARIANT_NUMBER = 0,
VARIANT_POSITION = 1,
Expand Down
1 change: 0 additions & 1 deletion src/mounts.cpp
Expand Up @@ -5,7 +5,6 @@

#include "mounts.h"

#include "definitions.h"
#include "pugicast.h"
#include "tools.h"

Expand Down
25 changes: 25 additions & 0 deletions src/otpch.h
Expand Up @@ -7,24 +7,49 @@
// Definitions should be global.
#include "definitions.h"

// System headers required in headers should be included here.
#include <algorithm>
#include <array>
#include <atomic>
#include <bitset>
#include <boost/asio.hpp>
#include <boost/iostreams/device/mapped_file.hpp>
#include <boost/lockfree/stack.hpp>
#include <boost/variant.hpp>
#include <cassert>
#include <condition_variable>
#include <cryptopp/rsa.h>
#include <cstdint>
#include <cstdlib>
#include <deque>
#include <fmt/color.h>
#include <forward_list>
#include <functional>
#include <iostream>
#include <limits>
#include <list>
#include <map>
#include <memory>
#include <mutex>
#include <mysql/mysql.h>
#include <pugixml.hpp>
#include <random>
#include <set>
#include <sstream>
#include <string_view>
#include <string>
#include <thread>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <valarray>
#include <variant>
#include <vector>

#if __has_include("luajit/lua.hpp")
#include <luajit/lua.hpp>
#else
#include <lua.hpp>
#endif

#endif // FS_OTPCH_H
2 changes: 0 additions & 2 deletions src/player.h
Expand Up @@ -14,8 +14,6 @@
#include "town.h"
#include "vocation.h"

#include <bitset>

class DepotChest;
class House;
class NetworkMessage;
Expand Down
2 changes: 0 additions & 2 deletions src/podium.h
Expand Up @@ -6,8 +6,6 @@

#include "item.h"

#include <bitset>

class Podium final : public Item
{
public:
Expand Down
1 change: 0 additions & 1 deletion src/protocolgame.h
Expand Up @@ -6,7 +6,6 @@

#include "chat.h"
#include "creature.h"
#include "definitions.h"
#include "protocol.h"
#include "tasks.h"

Expand Down
2 changes: 0 additions & 2 deletions src/pugicast.h
Expand Up @@ -4,8 +4,6 @@
#ifndef FS_PUGICAST_H
#define FS_PUGICAST_H

#include <cstdlib>

namespace pugi {

template<class T> T cast(const char* str);
Expand Down
2 changes: 0 additions & 2 deletions src/rsa.h
Expand Up @@ -4,8 +4,6 @@
#ifndef FS_RSA_H
#define FS_RSA_H

#include <cryptopp/rsa.h>

class RSA
{
public:
Expand Down
2 changes: 0 additions & 2 deletions src/spawn.h
Expand Up @@ -6,8 +6,6 @@

#include "position.h"

#include <utility>

class Monster;
class MonsterType;
class Npc;
Expand Down
2 changes: 0 additions & 2 deletions src/tasks.h
Expand Up @@ -6,8 +6,6 @@

#include "thread_holder_base.h"

#include <condition_variable>

using TaskFunc = std::function<void(void)>;
const int DISPATCHER_TASK_EXPIRATION = 2000;
const auto SYSTEM_TIME_ZERO = std::chrono::system_clock::time_point(std::chrono::milliseconds(0));
Expand Down
2 changes: 0 additions & 2 deletions src/thread_holder_base.h
Expand Up @@ -6,8 +6,6 @@

#include "enums.h"

#include <atomic>

template <typename Derived>
class ThreadHolder
{
Expand Down
1 change: 0 additions & 1 deletion src/tools.cpp
Expand Up @@ -6,7 +6,6 @@
#include "tools.h"

#include "configmanager.h"
#include "definitions.h"

#include <chrono>

Expand Down
3 changes: 0 additions & 3 deletions src/tools.h
Expand Up @@ -8,9 +8,6 @@
#include "enums.h"
#include "position.h"

#include <random>
#include <string_view>

void printXMLError(const std::string& where, const std::string& fileName, const pugi::xml_parse_result& result);

std::string transformToSHA1(const std::string& input);
Expand Down
2 changes: 0 additions & 2 deletions src/xtea.h
Expand Up @@ -4,8 +4,6 @@
#ifndef FS_XTEA_H
#define FS_XTEA_H

#include <array>

namespace xtea {

using key = std::array<uint32_t, 4>;
Expand Down

0 comments on commit f80456e

Please sign in to comment.