Change: include fmt.h C++ headers in stdafx.h

This to prevent compilation issues between runs with and without precompiled
headers. Also remove the headers from the rest of the code base as they are
not needed there anymore, although they do relatively little harm.
This commit is contained in:
Rubidium 2023-05-07 21:54:36 +02:00 committed by rubidium42
parent 192ed55462
commit 68ff3fd062
70 changed files with 17 additions and 94 deletions

View File

@ -12,7 +12,6 @@
#include "order_type.h" #include "order_type.h"
#include "timer/timer_game_calendar.h" #include "timer/timer_game_calendar.h"
#include <string>
/** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */ /** Various front vehicle properties that are preserved when autoreplacing, using order-backup or switching front engines within a consist. */
struct BaseConsist { struct BaseConsist {

View File

@ -10,7 +10,6 @@
#ifndef BITMAP_TYPE_HPP #ifndef BITMAP_TYPE_HPP
#define BITMAP_TYPE_HPP #define BITMAP_TYPE_HPP
#include <vector>
/** Represents a tile area containing containing individually set tiles. /** Represents a tile area containing containing individually set tiles.
* Each tile must be contained within the preallocated area. * Each tile must be contained within the preallocated area.

View File

@ -17,7 +17,6 @@
#include "landscape_type.h" #include "landscape_type.h"
#include "core/bitmath_func.hpp" #include "core/bitmath_func.hpp"
#include "core/span_type.hpp" #include "core/span_type.hpp"
#include <vector>
/** Globally unique label of a cargo type. */ /** Globally unique label of a cargo type. */
typedef uint32 CargoLabel; typedef uint32 CargoLabel;

View File

@ -13,7 +13,6 @@
#include "economy_type.h" #include "economy_type.h"
#include "strings_type.h" #include "strings_type.h"
#include "tile_type.h" #include "tile_type.h"
#include <vector>
struct GRFFile; struct GRFFile;

View File

@ -17,7 +17,6 @@
#include "timer/timer_game_calendar.h" #include "timer/timer_game_calendar.h"
#include "settings_type.h" #include "settings_type.h"
#include "group.h" #include "group.h"
#include <string>
#include <array> #include <array>
/** Statistics about the economy. */ /** Statistics about the economy. */

View File

@ -23,7 +23,6 @@
#include "timer/timer.h" #include "timer/timer.h"
#include "timer/timer_window.h" #include "timer/timer_window.h"
#include <deque> #include <deque>
#include <string>
#include "widgets/console_widget.h" #include "widgets/console_widget.h"

View File

@ -11,8 +11,6 @@
#define KDTREE_HPP #define KDTREE_HPP
#include "../stdafx.h" #include "../stdafx.h"
#include <vector>
#include <limits>
/** /**
* K-dimensional tree, specialised for 2-dimensional space. * K-dimensional tree, specialised for 2-dimensional space.

View File

@ -10,8 +10,6 @@
#ifndef MATH_FUNC_HPP #ifndef MATH_FUNC_HPP
#define MATH_FUNC_HPP #define MATH_FUNC_HPP
#include <limits>
#include <type_traits>
/** /**
* Returns the absolute value of (scalar) variable. * Returns the absolute value of (scalar) variable.

View File

@ -12,7 +12,6 @@
#include "math_func.hpp" #include "math_func.hpp"
#include <limits>
#ifdef __has_builtin #ifdef __has_builtin
# if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow) # if __has_builtin(__builtin_add_overflow) && __has_builtin(__builtin_sub_overflow) && __has_builtin(__builtin_mul_overflow)

View File

@ -11,7 +11,6 @@
#define SMALLVEC_TYPE_HPP #define SMALLVEC_TYPE_HPP
#include "mem_func.hpp" #include "mem_func.hpp"
#include <vector>
/** /**
* Helper function to append an item to a vector if it is not already contained * Helper function to append an item to a vector if it is not already contained

View File

@ -10,7 +10,6 @@
#include "stdafx.h" #include "stdafx.h"
#include "fileio_func.h" #include "fileio_func.h"
#include "debug.h" #include "debug.h"
#include <string>
std::string _log_file; ///< File to reroute output of a forked OpenTTD to std::string _log_file; ///< File to reroute output of a forked OpenTTD to
std::unique_ptr<FILE, FileDeleter> _log_fd; ///< File to reroute output of a forked OpenTTD to std::unique_ptr<FILE, FileDeleter> _log_fd; ///< File to reroute output of a forked OpenTTD to

View File

@ -16,7 +16,6 @@
#include "video/video_driver.hpp" #include "video/video_driver.hpp"
#include "string_func.h" #include "string_func.h"
#include "table/strings.h" #include "table/strings.h"
#include <string>
#include <sstream> #include <sstream>
#include "safeguards.h" #include "safeguards.h"

View File

@ -12,8 +12,6 @@
#include "core/enum_type.hpp" #include "core/enum_type.hpp"
#include "fileio_type.h" #include "fileio_type.h"
#include <string>
#include <vector>
void FioFCloseFile(FILE *f); void FioFCloseFile(FILE *f);
FILE *FioFOpenFile(const std::string &filename, const char *mode, Subdirectory subdir, size_t *filesize = nullptr); FILE *FioFOpenFile(const std::string &filename, const char *mode, Subdirectory subdir, size_t *filesize = nullptr);

View File

@ -20,8 +20,6 @@
#include "strings_func.h" #include "strings_func.h"
#include "tar_type.h" #include "tar_type.h"
#include <sys/stat.h> #include <sys/stat.h>
#include <functional>
#include <optional>
#include <charconv> #include <charconv>
#ifndef _WIN32 #ifndef _WIN32

View File

@ -29,7 +29,6 @@
#include <atomic> #include <atomic>
#include <mutex> #include <mutex>
#include <vector>
#include "safeguards.h" #include "safeguards.h"

View File

@ -22,7 +22,6 @@
#include "table/strgen_tables.h" #include "table/strgen_tables.h"
#include <stdarg.h> #include <stdarg.h>
#include <memory>
#include "../safeguards.h" #include "../safeguards.h"

View File

@ -10,7 +10,6 @@
#ifndef GAMELOG_H #ifndef GAMELOG_H
#define GAMELOG_H #define GAMELOG_H
#include <functional>
#include "newgrf_config.h" #include "newgrf_config.h"
/** The actions we log. */ /** The actions we log. */

View File

@ -15,11 +15,8 @@
#include "core/smallmap_type.hpp" #include "core/smallmap_type.hpp"
#include <map> #include <map>
#include <string>
#include <stack> #include <stack>
#include <string_view> #include <string_view>
#include <type_traits>
#include <vector>
/** /**
* Text drawing parameters, which can change while drawing a line, but are kept between multiple parts * Text drawing parameters, which can change while drawing a line, but are kept between multiple parts

View File

@ -16,7 +16,6 @@
#include "vehicle_type.h" #include "vehicle_type.h"
#include "engine_type.h" #include "engine_type.h"
#include "livery.h" #include "livery.h"
#include <string>
typedef Pool<Group, GroupID, 16, 64000> GroupPool; typedef Pool<Group, GroupID, 16, 64000> GroupPool;
extern GroupPool _group_pool; ///< Pool of groups. extern GroupPool _group_pool; ///< Pool of groups.

View File

@ -11,7 +11,6 @@
#define INDUSTRYTYPE_H #define INDUSTRYTYPE_H
#include <array> #include <array>
#include <vector>
#include "map_type.h" #include "map_type.h"
#include "slope_type.h" #include "slope_type.h"
#include "industry_type.h" #include "industry_type.h"

View File

@ -11,8 +11,6 @@
#define INI_TYPE_H #define INI_TYPE_H
#include "fileio_type.h" #include "fileio_type.h"
#include <string>
#include <optional>
/** Types of groups */ /** Types of groups */
enum IniGroupType { enum IniGroupType {

View File

@ -16,7 +16,6 @@
#include "../window_gui.h" #include "../window_gui.h"
#include "linkgraph_base.h" #include "linkgraph_base.h"
#include <map> #include <map>
#include <vector>
/** /**
* Monthly statistics for a link between two stations. * Monthly statistics for a link between two stations.

View File

@ -4,7 +4,6 @@
#define MCF_H #define MCF_H
#include "linkgraphjob_base.h" #include "linkgraphjob_base.h"
#include <vector>
typedef std::vector<Path *> PathVector; typedef std::vector<Path *> PathVector;

View File

@ -12,7 +12,6 @@
#include "../cargo_type.h" #include "../cargo_type.h"
#include "../vehicle_base.h" #include "../vehicle_base.h"
#include <vector>
#include <map> #include <map>
#include <set> #include <set>

View File

@ -12,7 +12,6 @@
#include <map> #include <map>
#include <stack> #include <stack>
#include <string>
#include "../direction_type.h" #include "../direction_type.h"
#include "../signal_type.h" #include "../signal_type.h"

View File

@ -10,7 +10,6 @@
#ifndef ENDIAN_BUFFER_HPP #ifndef ENDIAN_BUFFER_HPP
#define ENDIAN_BUFFER_HPP #define ENDIAN_BUFFER_HPP
#include <iterator>
#include <string_view> #include <string_view>
#include "../core/span_type.hpp" #include "../core/span_type.hpp"
#include "../core/bitmath_func.hpp" #include "../core/bitmath_func.hpp"

View File

@ -12,9 +12,7 @@
#include <utility> #include <utility>
#include <list> #include <list>
#include <functional>
#include <unordered_map> #include <unordered_map>
#include <stdexcept>
/** /**
* Size limited cache with a least recently used eviction strategy. * Size limited cache with a least recently used eviction strategy.

View File

@ -13,8 +13,6 @@
#include "../stdafx.h" #include "../stdafx.h"
#include "../core/smallvec_type.hpp" #include "../core/smallvec_type.hpp"
#include "midi.h" #include "midi.h"
#include <vector>
#include <string>
struct MusicSongInfo; struct MusicSongInfo;

View File

@ -8,7 +8,6 @@
/** @file music_gui.cpp GUI for the music playback. */ /** @file music_gui.cpp GUI for the music playback. */
#include "stdafx.h" #include "stdafx.h"
#include <vector>
#include "openttd.h" #include "openttd.h"
#include "base_media_base.h" #include "base_media_base.h"
#include "music/music_driver.hpp" #include "music/music_driver.hpp"

View File

@ -16,7 +16,6 @@
#include "../../string_func.h" #include "../../string_func.h"
#include "../../core/smallmap_type.hpp" #include "../../core/smallmap_type.hpp"
#include <string>
class NetworkAddress; class NetworkAddress;
typedef std::vector<NetworkAddress> NetworkAddressList; ///< Type for a list of addresses. typedef std::vector<NetworkAddress> NetworkAddressList; ///< Type for a list of addresses.

View File

@ -11,7 +11,6 @@
#include "../../stdafx.h" #include "../../stdafx.h"
#include <cstdlib>
#include "../../string_func.h" #include "../../string_func.h"
#include "../../safeguards.h" #include "../../safeguards.h"

View File

@ -21,7 +21,6 @@
#include <atomic> #include <atomic>
#include <condition_variable> #include <condition_variable>
#include <curl/curl.h> #include <curl/curl.h>
#include <memory>
#include <mutex> #include <mutex>
#include <queue> #include <queue>

View File

@ -16,8 +16,6 @@
#include "config.h" #include "config.h"
#include "core.h" #include "core.h"
#include "../../string_type.h" #include "../../string_type.h"
#include <functional>
#include <limits>
typedef uint16 PacketSize; ///< Size of the whole packet. typedef uint16 PacketSize; ///< Size of the whole packet.
typedef uint8 PacketType; ///< Identifier for the packet typedef uint8 PacketType; ///< Identifier for the packet

View File

@ -12,8 +12,6 @@
#ifndef NETWORK_CORE_TCP_CONTENT_TYPE_H #ifndef NETWORK_CORE_TCP_CONTENT_TYPE_H
#define NETWORK_CORE_TCP_CONTENT_TYPE_H #define NETWORK_CORE_TCP_CONTENT_TYPE_H
#include <optional>
/** The values in the enum are important; they are used as database 'keys' */ /** The values in the enum are important; they are used as database 'keys' */
enum ContentType { enum ContentType {
CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types CONTENT_TYPE_BEGIN = 1, ///< Helper to mark the begin of the types

View File

@ -12,7 +12,6 @@
#include "strings_type.h" #include "strings_type.h"
#include <vector>
/** /**
* Struct containing information relating to NewGRF classes for stations and airports. * Struct containing information relating to NewGRF classes for stations and airports.

View File

@ -17,7 +17,6 @@
#include "fileio_type.h" #include "fileio_type.h"
#include "textfile_type.h" #include "textfile_type.h"
#include "newgrf_text.h" #include "newgrf_text.h"
#include <optional>
/** GRF config bit flags */ /** GRF config bit flags */
enum GCF_Flags { enum GCF_Flags {

View File

@ -17,9 +17,6 @@
#include "newgrf_callbacks.h" #include "newgrf_callbacks.h"
#include "newgrf_spritegroup.h" #include "newgrf_spritegroup.h"
#include <vector>
#include <string>
#include <memory>
/** /**
* Callback profiler for NewGRF development * Callback profiler for NewGRF development

View File

@ -15,8 +15,6 @@
#include "core/smallvec_type.hpp" #include "core/smallvec_type.hpp"
#include "table/control_codes.h" #include "table/control_codes.h"
#include <utility> #include <utility>
#include <vector>
#include <string>
/** This character, the thorn ('þ'), indicates a unicode string to NFO. */ /** This character, the thorn ('þ'), indicates a unicode string to NFO. */
static const WChar NFO_UTF8_IDENTIFIER = 0x00DE; static const WChar NFO_UTF8_IDENTIFIER = 0x00DE;

View File

@ -13,7 +13,6 @@
#ifndef NEWGRF_TOWNNAME_H #ifndef NEWGRF_TOWNNAME_H
#define NEWGRF_TOWNNAME_H #define NEWGRF_TOWNNAME_H
#include <vector>
#include "strings_type.h" #include "strings_type.h"
struct NamePart { struct NamePart {

View File

@ -18,7 +18,6 @@
#include "../../strings_func.h" #include "../../strings_func.h"
#include "../../zoom_func.h" #include "../../zoom_func.h"
#include "macos.h" #include "macos.h"
#include <cmath>
#include "../../table/control_codes.h" #include "../../table/control_codes.h"

View File

@ -15,7 +15,6 @@
#include "../../fontcache.h" #include "../../fontcache.h"
#include "../../zoom_func.h" #include "../../zoom_func.h"
#include "macos.h" #include "macos.h"
#include <cmath>
#include <CoreFoundation/CoreFoundation.h> #include <CoreFoundation/CoreFoundation.h>

View File

@ -12,7 +12,6 @@
#include "../../gfx_layout.h" #include "../../gfx_layout.h"
#include "../../string_base.h" #include "../../string_base.h"
#include <vector>
/** String iterator using CoreText as a backend. */ /** String iterator using CoreText as a backend. */
class OSXStringIterator : public StringIterator { class OSXStringIterator : public StringIterator {

View File

@ -16,7 +16,6 @@
#include "../../table/control_codes.h" #include "../../table/control_codes.h"
#include "../../zoom_func.h" #include "../../zoom_func.h"
#include "win32.h" #include "win32.h"
#include <vector>
#include <windows.h> #include <windows.h>
#include <usp10.h> #include <usp10.h>

View File

@ -12,7 +12,6 @@
#include "../../gfx_layout.h" #include "../../gfx_layout.h"
#include "../../string_base.h" #include "../../string_base.h"
#include <vector>
void UniscribeResetScriptCache(FontSize size); void UniscribeResetScriptCache(FontSize size);

View File

@ -10,7 +10,6 @@
#ifndef YAPF_COSTRAIL_HPP #ifndef YAPF_COSTRAIL_HPP
#define YAPF_COSTRAIL_HPP #define YAPF_COSTRAIL_HPP
#include <vector>
#include "../../pbs.h" #include "../../pbs.h"

View File

@ -11,7 +11,6 @@
#define RANDOM_ACCESS_FILE_TYPE_H #define RANDOM_ACCESS_FILE_TYPE_H
#include "fileio_type.h" #include "fileio_type.h"
#include <string>
/** /**
* A file from which bytes, words and double words are read in (potentially) a random order. * A file from which bytes, words and double words are read in (potentially) a random order.

View File

@ -19,7 +19,6 @@
#include "newgrf.h" #include "newgrf.h"
#include "economy_func.h" #include "economy_func.h"
#include <vector>
enum RoadTramType : bool { enum RoadTramType : bool {
RTT_ROAD, RTT_ROAD,

View File

@ -15,7 +15,6 @@
#include "saveload_internal.h" #include "saveload_internal.h"
#include "../engine_base.h" #include "../engine_base.h"
#include "../string_func.h" #include "../string_func.h"
#include <vector>
#include "../safeguards.h" #include "../safeguards.h"

View File

@ -19,7 +19,6 @@
#include "saveload_internal.h" #include "saveload_internal.h"
#include "oldloader.h" #include "oldloader.h"
#include <exception>
#include "../safeguards.h" #include "../safeguards.h"

View File

@ -44,8 +44,6 @@
#include "../error.h" #include "../error.h"
#include <atomic> #include <atomic>
#include <deque> #include <deque>
#include <vector>
#include <string>
#ifdef __EMSCRIPTEN__ #ifdef __EMSCRIPTEN__
# include <emscripten.h> # include <emscripten.h>
#endif #endif

View File

@ -14,9 +14,6 @@
#include "../fileio_type.h" #include "../fileio_type.h"
#include "../fios.h" #include "../fios.h"
#include "../core/span_type.hpp" #include "../core/span_type.hpp"
#include <optional>
#include <string>
#include <vector>
/** SaveLoad versions /** SaveLoad versions
* Previous savegame versions, the trunk revision where they were * Previous savegame versions, the trunk revision where they were

View File

@ -10,7 +10,6 @@
#ifndef SCRIPT_ADMIN_HPP #ifndef SCRIPT_ADMIN_HPP
#define SCRIPT_ADMIN_HPP #define SCRIPT_ADMIN_HPP
#include <string>
#include "script_object.hpp" #include "script_object.hpp"
/** /**

View File

@ -13,7 +13,6 @@
#include "script_object.hpp" #include "script_object.hpp"
#include <utility> #include <utility>
#include <vector>
/** /**
* Class that creates a queue which keeps its items ordered by an item priority. * Class that creates a queue which keeps its items ordered by an item priority.

View File

@ -20,7 +20,6 @@
#include "script_log_types.hpp" #include "script_log_types.hpp"
#include "table/strings.h" #include "table/strings.h"
#include <vector>
/** /**
* The callback function for Mode-classes. * The callback function for Mode-classes.

View File

@ -10,7 +10,6 @@
#ifndef SQUIRREL_HELPER_TYPE_HPP #ifndef SQUIRREL_HELPER_TYPE_HPP
#define SQUIRREL_HELPER_TYPE_HPP #define SQUIRREL_HELPER_TYPE_HPP
#include <vector>
/** Definition of a simple array. */ /** Definition of a simple array. */
template <typename Titem = int32> template <typename Titem = int32>

View File

@ -42,8 +42,6 @@
#include "gui.h" #include "gui.h"
#include "mixer.h" #include "mixer.h"
#include <vector>
#include <iterator>
#include "safeguards.h" #include "safeguards.h"
#include "video/video_driver.hpp" #include "video/video_driver.hpp"

View File

@ -14,7 +14,6 @@
#include "viewport_type.h" #include "viewport_type.h"
#include "core/pool_type.hpp" #include "core/pool_type.hpp"
#include "company_type.h" #include "company_type.h"
#include <string>
typedef Pool<Sign, SignID, 16, 64000> SignPool; typedef Pool<Sign, SignID, 16, 64000> SignPool;
extern SignPool _sign_pool; extern SignPool _sign_pool;

View File

@ -38,7 +38,6 @@
#include "table/strings.h" #include "table/strings.h"
#include <set> #include <set>
#include <vector>
#include "safeguards.h" #include "safeguards.h"

View File

@ -14,7 +14,6 @@
#include "tilearea_type.h" #include "tilearea_type.h"
#include "window_type.h" #include "window_type.h"
#include "station_type.h" #include "station_type.h"
#include <functional>
/** Types of cargo to display for station coverage. */ /** Types of cargo to display for station coverage. */

View File

@ -53,15 +53,28 @@
#endif #endif
#include <algorithm> #include <algorithm>
#include <cstdio> #include <cassert>
#include <cstdint> #include <cctype>
#include <cerrno>
#include <climits>
#include <cmath>
#include <cstdarg>
#include <cstddef> #include <cstddef>
#include <cstdint>
#include <cstdio>
#include <cstring> #include <cstring>
#include <cstdlib> #include <cstdlib>
#include <climits> #include <cwchar>
#include <cassert> #include <exception>
#include <functional>
#include <iterator>
#include <limits>
#include <memory> #include <memory>
#include <optional>
#include <stdexcept>
#include <string> #include <string>
#include <type_traits>
#include <vector>
#if defined(UNIX) || defined(__MINGW32__) #if defined(UNIX) || defined(__MINGW32__)
# include <sys/types.h> # include <sys/types.h>

View File

@ -17,7 +17,6 @@
#include "strgen.h" #include "strgen.h"
#include <exception>
#if !defined(_WIN32) || defined(__CYGWIN__) #if !defined(_WIN32) || defined(__CYGWIN__)
#include <unistd.h> #include <unistd.h>

View File

@ -11,8 +11,6 @@
#define STRING_TYPE_H #define STRING_TYPE_H
#include "core/enum_type.hpp" #include "core/enum_type.hpp"
#include <vector>
#include <string>
/** A non-breaking space. */ /** A non-breaking space. */
#define NBSP u8"\u00a0" #define NBSP u8"\u00a0"

View File

@ -11,7 +11,6 @@
#define TAR_TYPE_H #define TAR_TYPE_H
#include <map> #include <map>
#include <string>
#include <array> #include <array>
#include "fileio_type.h" #include "fileio_type.h"

View File

@ -14,7 +14,6 @@
#include "strings_func.h" #include "strings_func.h"
#include "textfile_type.h" #include "textfile_type.h"
#include "window_gui.h" #include "window_gui.h"
#include <optional>
std::optional<std::string> GetTextfile(TextfileType type, Subdirectory dir, const std::string &filename); std::optional<std::string> GetTextfile(TextfileType type, Subdirectory dir, const std::string &filename);

View File

@ -12,7 +12,6 @@
#include "timer_manager.h" #include "timer_manager.h"
#include <functional>
/** /**
* The base where every other type of timer is derived from. * The base where every other type of timer is derived from.

View File

@ -24,7 +24,6 @@
#include "settings_type.h" #include "settings_type.h"
#include "timetable_cmd.h" #include "timetable_cmd.h"
#include "timetable.h" #include "timetable.h"
#include <cstdint>
#include "widgets/timetable_widget.h" #include "widgets/timetable_widget.h"

View File

@ -17,7 +17,6 @@
#include "town_type.h" #include "town_type.h"
#include "string_type.h" #include "string_type.h"
#include <set> #include <set>
#include <string>
typedef std::set<std::string> TownNames; typedef std::set<std::string> TownNames;

View File

@ -20,7 +20,6 @@
#include "window_gui.h" #include "window_gui.h"
#include "widgets/dropdown_type.h" #include "widgets/dropdown_type.h"
#include <iterator>
#include <numeric> #include <numeric>
typedef GUIList<const Vehicle*, CargoID> GUIVehicleList; typedef GUIList<const Vehicle*, CargoID> GUIVehicleList;

View File

@ -21,8 +21,6 @@
#include <condition_variable> #include <condition_variable>
#include <mutex> #include <mutex>
#include <thread> #include <thread>
#include <vector>
#include <functional>
extern std::string _ini_videodriver; extern std::string _ini_videodriver;
extern std::vector<Dimension> _resolutions; extern std::vector<Dimension> _resolutions;

View File

@ -11,8 +11,6 @@
#define WINDOW_GUI_H #define WINDOW_GUI_H
#include <list> #include <list>
#include <algorithm>
#include <functional>
#include "vehiclelist.h" #include "vehiclelist.h"
#include "vehicle_type.h" #include "vehicle_type.h"