Include what you use

Applied IWYU recommendations (mostly).

I deviated on libraries, it always wanted me to include the inner headers
for SDL, ffmpeg, etc. but the definitions were normally expected to be
exported by a top level header. wxWidgets was particularly problematic
since it wanted me to use the gtk specific includes instead of the
generic ones.

I do not intend to add include-what-you-use to the CI/CD pipelines at
this time but some pragmas were added to the code to make it report
somewhat cleaner.
This commit is contained in:
Stephen E. Baker
2025-05-06 23:24:26 -04:00
parent a86694a468
commit de7f8bb6d9
57 changed files with 270 additions and 105 deletions

View File

@@ -22,8 +22,6 @@ SOFTWARE.
#include "app.h"
#include "config.h"
#include "frmMain.h"
#include "frmSprites.h"

View File

@@ -23,7 +23,6 @@ SOFTWARE.
#ifndef ANIMVIEW_APP_H_
#define ANIMVIEW_APP_H_
#include "config.h"
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"

View File

@@ -24,8 +24,8 @@ SOFTWARE.
#define CORSIX_AV_CONFIG_H_
/** Standard includes **/
#include <cstddef>
#include <cstdint>
#include <cstddef> // IWYU pragma: export
#include <cstdint> // IWYU pragma: export
// We bring in the most common stddef and stdint types to avoid typing
using std::size_t;

View File

@@ -24,21 +24,36 @@ SOFTWARE.
#include "config.h"
#include <wx/anybutton.h>
#include <wx/bitmap.h>
#include <wx/button.h>
#include <wx/chartype.h>
#include <wx/checkbox.h>
#include <wx/dcclient.h>
#include <wx/dcmemory.h>
#include <wx/defs.h>
#include <wx/dir.h>
#include <wx/dirdlg.h>
#include <wx/filename.h>
#include <wx/gdicmn.h>
#include <wx/image.h>
#include <wx/listbox.h>
#include <wx/msgdlg.h>
#include <wx/numdlg.h>
#include <wx/object.h>
#include <wx/panel.h>
#include <wx/radiobut.h>
#include <wx/sizer.h>
#include <wx/spinbutt.h>
#include <wx/spinctrl.h>
#include <wx/stattext.h>
#include <wx/stringimpl.h>
#include <wx/textctrl.h>
#include <wx/tokenzr.h>
#include <wx/wfstream.h>
#include <wx/unichar.h>
#include <wx/utils.h>
#include <cstring>
#include "backdrop.h"

View File

@@ -25,19 +25,22 @@ SOFTWARE.
#include "config.h"
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/dcclient.h>
#include <wx/defs.h>
#include <wx/event.h>
#include <wx/frame.h>
#include <wx/listbox.h>
#include <wx/panel.h>
#include <wx/spinctrl.h>
#include <wx/textctrl.h>
#include <wx/image.h>
#include <wx/string.h>
#include <wx/timer.h>
#include <wx/txtstrm.h>
#include "th.h"
//#include <vector>
class wxButton;
class wxCheckBox;
class wxListBox;
class wxPaintDC;
class wxPanel;
class wxSpinEvent;
class wxTextCtrl;
class frmMain : public wxFrame {
public:

View File

@@ -24,13 +24,19 @@ SOFTWARE.
#include "config.h"
#include <wx/button.h>
#include <wx/chartype.h>
#include <wx/dcclient.h>
#include <wx/dirdlg.h>
#include <wx/filedlg.h>
#include <wx/filefn.h>
#include <wx/gdicmn.h>
#include <wx/image.h>
#include <wx/msgdlg.h>
#include <wx/sizer.h>
#include <wx/stattext.h>
#include <wx/vscroll.h>
#include <wx/textctrl.h>
#include <wx/unichar.h>
#include <wx/utils.h>
BEGIN_EVENT_TABLE(frmSprites, wxFrame)
EVT_BUTTON(ID_LOAD, frmSprites::_onLoad)

View File

@@ -26,19 +26,20 @@ SOFTWARE.
#include "config.h"
#include <wx/bitmap.h>
#include <wx/button.h>
#include <wx/checkbox.h>
#include <wx/defs.h>
#include <wx/event.h>
#include <wx/frame.h>
#include <wx/listbox.h>
#include <wx/panel.h>
#include <wx/textctrl.h>
#include <wx/timer.h>
#include <wx/string.h>
#include <wx/types.h>
#include <wx/vscroll.h>
#include <vector>
#include "th.h"
class wxTextCtrl;
class wxWindow;
static const int ROW_COUNT = 1000;
// Derived class to add scrollbars to the window.

View File

@@ -24,9 +24,8 @@ SOFTWARE.
#include "config.h"
#include <wx/app.h>
#include <wx/filename.h>
#include <wx/toplevel.h>
#include <wx/gdicmn.h>
#include <wx/image.h>
#include <algorithm>
#include <array>

View File

@@ -39,15 +39,16 @@ SOFTWARE.
#include "config.h"
#include <stdint.h>
#include <wx/file.h>
#include <wx/image.h>
#include <wx/string.h>
#include <wx/txtstrm.h>
#include <array>
#include <cstring>
#include <vector>
class wxImage;
class wxSize;
#pragma pack(push)
#pragma pack(1)

View File

@@ -1,3 +1,4 @@
#include "../Src/lua.hpp"
#include "../Src/th_lua.h"
#include <catch2/catch_test_macros.hpp>

View File

@@ -1,7 +1,8 @@
#include <cstring>
#include <string>
#include "../Src/th_strings.h"
#include <catch2/catch_test_macros.hpp>
#include <catch2/matchers/catch_matchers.hpp>
#include <catch2/matchers/catch_matchers_string.hpp>
TEST_CASE("skip whitespace", "[skip_utf8_whitespace]") {

View File

@@ -79,8 +79,8 @@ SOFTWARE.
#endif
/** Standard includes **/
#include <cstddef>
#include <cstdint>
#include <cstddef> // IWYU pragma: export
#include <cstdint> // IWYU pragma: export
// We bring in the most common stddef and stdint types to avoid typing
// clang-format off

View File

@@ -1,6 +1,8 @@
#ifndef CORSIX_TH_CP437_TO_UNICODE_TABLE_H
#define CORSIX_TH_CP437_TO_UNICODE_TABLE_H
#include "config.h"
#include <array>
// clang-format off

View File

@@ -1,6 +1,8 @@
#ifndef CORSIX_TH_CP936_TO_UNICODE_TABLE_H
#define CORSIX_TH_CP936_TO_UNICODE_TABLE_H
#include "config.h"
#include <array>
// Generated from the following document:
// http://www.unicode.org/Public/MAPPINGS/VENDORS/MICSFT/WINDOWS/CP936.TXT

View File

@@ -23,14 +23,14 @@ SOFTWARE.
#include "iso_fs.h"
#include <algorithm>
#include <array>
#include <cstdarg>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <exception>
#include <iterator>
#include <memory>
#include <stdexcept>
#include <utility>
#include <vector>
#include "th.h"

View File

@@ -27,8 +27,7 @@ SOFTWARE.
#include <cstdio>
#include <string>
#include "th_lua.h"
#include <vector>
//! Layer for reading Theme Hospital files out of an .iso disk image
/*!

View File

@@ -24,9 +24,12 @@ SOFTWARE.
#define CORSIX_TH_LUA_HPP_
extern "C" {
#include <lauxlib.h>
// IWYU pragma: begin_exports
#include <lua.h>
#include <luaconf.h>
#include <lualib.h>
#include <lauxlib.h>
// IWYU pragma: end_exports
}
#if LUA_VERSION_NUM >= 502

View File

@@ -1,5 +1,7 @@
#include "lua_rnc.h"
#include "config.h"
#include <array>
#include "rnc.h"

View File

@@ -1,7 +1,7 @@
#ifndef CORSIX_TH_LUA_RNC
#define CORSIX_TH_LUA_RNC
#include "th_lua.h"
#include "lua.hpp"
int luaopen_rnc(lua_State* L);

View File

@@ -22,13 +22,12 @@ SOFTWARE.
#include "config.h"
#include <array>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <fstream>
#include <string>
#include "iso_fs.h"
#include "lua.hpp"
#include "lua_rnc.h"
#include "lua_sdl.h"

View File

@@ -22,15 +22,19 @@ SOFTWARE.
#include "persist_lua.h"
#include "config.h"
#include <errno.h>
#include <array>
#include <climits>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <new>
#include <string>
#include "lua.hpp"
#include "th_lua.h"
#ifdef _MSC_VER
#pragma warning( \

View File

@@ -24,10 +24,10 @@ SOFTWARE.
#define CORSIX_TH_PERSIST_LUA_H_
#include "config.h"
#include <cstdlib>
#include <type_traits>
#include <vector>
#include "th_lua.h"
#include "lua.hpp"
template <class T>
struct lua_persist_int {};

View File

@@ -43,6 +43,7 @@
#include <lauxlib.h>
#include <lua.h>
#include <stddef.h>
#ifdef _MSC_VER
typedef unsigned __int16 uint16_t;
typedef unsigned __int32 uint32_t;

View File

@@ -22,13 +22,18 @@ SOFTWARE.
#include "config.h"
#include "lua.hpp"
#include "lua_sdl.h"
#include "th_lua.h"
#ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_events.h>
#include <SDL_mixer.h>
#include <SDL_rwops.h>
#include <SDL_thread.h>
#include <array>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include "xmi2mid.h"

View File

@@ -20,12 +20,13 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "config.h"
#include <SDL.h>
#include <array>
#include <cstdio>
#include <cstring>
#include "lua.hpp"
#include "lua_sdl.h"
#include "th_lua.h"

View File

@@ -20,9 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "config.h"
#include "lua_sdl.h"
#include "lua.hpp"
#include "th_lua.h"
#ifdef CORSIX_TH_USE_WIN32_SDK
#include <SDL_syswm.h>
@@ -30,6 +28,8 @@ SOFTWARE.
#include "../resource.h"
#endif
#include <SDL_mouse.h>
#include <array>
namespace {

View File

@@ -24,9 +24,12 @@ SOFTWARE.
#include "config.h"
#include <cstring>
#include <array>
#include <stdexcept>
#include "cp437_table.h"
#include "cp936_table.h"
link_list::link_list() {
prev = nullptr;
next = nullptr;
@@ -45,9 +48,6 @@ void link_list::remove_from_list() {
prev = nullptr;
}
#include "cp437_table.h"
#include "cp936_table.h"
namespace {
void utf8encode(uint8_t*& sOut, uint32_t iCodepoint) {

View File

@@ -27,10 +27,14 @@ SOFTWARE.
#include <algorithm>
#include <cassert>
#include <climits>
#include <cstdlib>
#include <cstring>
#include <memory>
#include <new>
#include "persist_lua.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_map.h"
#include "th_sound.h"

View File

@@ -23,19 +23,26 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_GFX_H_
#define CORSIX_TH_TH_GFX_H_
#include "config.h"
#include <cstdio>
#include <cstring>
#include <map>
#include <string>
#include <utility>
#include <vector>
#include "lua.hpp"
#include "th.h"
#include "th_gfx_common.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
class lua_persist_reader;
class lua_persist_writer;
class memory_reader;
class render_target;
class sprite_sheet;
struct clip_rect;
struct map_tile;
enum class scaled_items { none, sprite_sheets, bitmaps, all };
@@ -210,8 +217,6 @@ struct layers {
uint8_t layer_contents[max_number_of_layers];
};
class memory_reader;
/** Key value for finding an animation. */
struct animation_key {
std::string name; ///< Name of the animations.
@@ -525,7 +530,6 @@ class animation_manager {
void fix_next_frame(uint32_t iFirst, size_t iLength);
};
struct map_tile;
class animation_base : public drawable {
public:
animation_base();

View File

@@ -26,14 +26,18 @@ SOFTWARE.
#include "th_strings.h"
#ifdef CORSIX_TH_USE_FREETYPE2
#include <ft2build.h> // IWYU pragma: keep
#include FT_FREETYPE_H
#include FT_ERRORS_H
#include FT_GLYPH_H
#include FT_IMAGE_H
#include FT_TYPES_H
#include <map>
#include <vector>
#endif
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <stdexcept>
#include <utility>
bitmap_font::bitmap_font() {
sheet = nullptr;

View File

@@ -22,16 +22,20 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_GFX_FONT_H_
#define CORSIX_TH_TH_GFX_FONT_H_
#include "th_gfx.h"
#include "config.h"
#include <SDL_render.h>
#include <climits>
#include "th_gfx_sdl.h"
#ifdef CORSIX_TH_USE_FREETYPE2
#include <ft2build.h>
#include <ft2build.h> // IWYU pragma: keep
#include FT_FREETYPE_H
#include FT_IMAGE_H
#include FT_TYPES_H
#endif
class render_target;
class sprite_sheet;
enum class text_alignment {
left = 0,
center = 1,

View File

@@ -26,19 +26,23 @@ SOFTWARE.
#ifdef CORSIX_TH_USE_FREETYPE2
#include "th_gfx_font.h"
#endif
#include <SDL.h>
#include <algorithm>
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <limits>
#include <memory>
#include <new>
#include <stack>
#include <stdexcept>
#include <vector>
#include "th_map.h"
#include "persist_lua.h"
#include "th_gfx_common.h"
#include "th_gfx_sdl.h"
#if SDL_VERSION_ATLEAST(2, 0, 10)

View File

@@ -32,11 +32,12 @@ SOFTWARE.
#include <stdexcept>
#include <vector>
#include "persist_lua.h"
#include "th.h"
#include "th_gfx_common.h"
class cursor;
class line_sequence;
class lua_persist_reader;
class lua_persist_writer;
struct clip_rect : public SDL_Rect {
typedef Sint16 x_y_type;

View File

@@ -32,7 +32,9 @@ SOFTWARE.
#endif
#include "bootstrap.h"
#include "lua.hpp"
#include "th.h"
#include "th_lua.h"
#include "th_lua_internal.h"
const char* update_check_url =
@@ -237,7 +239,7 @@ int l_load_strings(lua_State* L) {
}
int get_api_version() {
#include "../Lua/api_version.lua"
#include "../Lua/api_version.lua" // IWYU pragma: keep
}
int l_get_compile_options(lua_State* L) {

View File

@@ -25,9 +25,7 @@ SOFTWARE.
#include "config.h"
#include <cassert>
#include <cstdio>
#include <new>
#include <vector>
#include "lua.hpp"

View File

@@ -20,10 +20,23 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "config.h"
#include <new>
#include <string>
#include "lua.hpp"
#include "persist_lua.h"
#include "th.h"
#include "th_gfx.h"
#include "th_lua.h"
#include "th_lua_internal.h"
#include "th_map.h"
class render_target;
class sprite_sheet;
enum class animation_effect;
namespace {
/* this variable is used to determine the layer of the animation, it should be

View File

@@ -20,15 +20,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <SDL.h>
#include "config.h"
#include <SDL_stdinc.h>
#include <climits>
#include <cstring>
#include <exception>
#include <new>
#include "lua.hpp"
#include "persist_lua.h"
#include "th_gfx.h"
#include "th_gfx_font.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h"
#ifdef CORSIX_TH_USE_FREETYPE2
#include <ft2build.h> // IWYU pragma: keep
#include FT_ERRORS_H
#include FT_TYPES_H
#endif
namespace {
int l_palette_new(lua_State* L) {

View File

@@ -20,9 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <cstdio>
#include "config.h"
#include "iso_fs.h"
#include "lua.hpp"
#include "th_lua.h"
#include "th_lua_internal.h"
namespace {

View File

@@ -21,8 +21,8 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "config.h"
#include "lua.hpp"
#include "th_lua.h"
#include "th_lua_internal.h"
#ifdef CORSIX_TH_USE_WIN32_SDK
#include <windows.h>

View File

@@ -20,14 +20,28 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <cstring>
#include <exception>
#include <string>
#include "config.h"
#include <cstring>
#include <list>
#include <map>
#include <stdexcept>
#include <string>
#include <utility>
#include <vector>
#include "lua.hpp"
#include "th_gfx.h"
#include "th_lua.h"
#include "th_lua_internal.h"
#include "th_map.h"
#include "th_pathfind.h"
class lua_persist_reader;
class lua_persist_writer;
class render_target;
class sprite_sheet;
namespace {
constexpr int player_max = 4;

View File

@@ -20,7 +20,11 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "th_gfx.h"
#include <SDL_rect.h>
#include "lua.hpp"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h"
#include "th_movie.h"

View File

@@ -20,11 +20,20 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "config.h"
#include <SDL_events.h>
#include <SDL_rwops.h>
#include <SDL_stdinc.h>
#include <SDL_timer.h>
#include <array>
#include <cctype>
#include <cstring>
#include <cstdio>
#include <map>
#include <utility>
#include "lua.hpp"
#include "lua_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h"

View File

@@ -20,10 +20,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include "config.h"
#include <cstring>
#include <vector>
#include "lua.hpp"
#include "persist_lua.h"
#include "th_lua.h"
#include "th_lua_internal.h"
/*

View File

@@ -20,9 +20,14 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <algorithm>
#include "config.h"
#include "th_gfx.h"
#include <algorithm>
#include <list>
#include "lua.hpp"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_lua_internal.h"
#include "th_map.h"

View File

@@ -24,19 +24,20 @@ SOFTWARE.
#include "config.h"
#include <SDL.h>
#include <algorithm>
#include <cstdio>
#include <cstring>
#include <exception>
#include <fstream>
#include <new>
#include <stdexcept>
#include <string>
#include "lua.hpp"
#include "persist_lua.h"
#include "run_length_encoder.h"
#include "th.h"
#include "th_gfx.h"
#include "th_gfx_sdl.h"
#include "th_lua.h"
#include "th_map_overlays.h"
constexpr int max_player_count = 4;

View File

@@ -22,10 +22,21 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_MAP_H_
#define CORSIX_TH_TH_MAP_H_
#include "config.h"
#include <list>
#include <string>
#include <utility>
#include <vector>
#include "th_gfx.h"
#include "th.h"
class lua_persist_reader;
class lua_persist_writer;
class map_overlay;
class render_target;
class sprite_sheet;
struct drawable;
/*
Object type enumeration uses same values as original TH does.
@@ -212,8 +223,6 @@ struct map_tile {
std::list<object_type> objects;
};
class sprite_sheet;
//! Prototype for object callbacks from THMap::loadFromTHFile
/*!
The callback function will receive 5 arguments:
@@ -226,8 +235,6 @@ class sprite_sheet;
typedef void (*map_load_object_callback_fn)(void*, int, int, object_type,
uint8_t);
class map_overlay;
class level_map {
public:
level_map();

View File

@@ -23,10 +23,11 @@ SOFTWARE.
#include "th_map_overlays.h"
#include <array>
#include <list>
#include <sstream>
#include "th_gfx.h"
#include "th_gfx_font.h"
#include "th_gfx_sdl.h"
#include "th_map.h"
map_overlay_pair::map_overlay_pair() {

View File

@@ -27,21 +27,31 @@ SOFTWARE.
#include "lua_sdl.h"
#if defined(CORSIX_TH_USE_FFMPEG) && defined(CORSIX_TH_USE_SDL_MIXER)
#include "th_gfx.h"
extern "C" {
#include <libavcodec/avcodec.h>
#include <libavutil/avutil.h>
#include <libavutil/channel_layout.h>
#include <libavutil/error.h>
#include <libavutil/imgutils.h>
#include <libavutil/mathematics.h>
#include <libavutil/opt.h>
#include <libavutil/rational.h>
#include <libavutil/samplefmt.h>
#include <libswresample/version.h>
#include <libswscale/swscale.h>
}
#include <SDL_error.h>
#include <SDL_events.h>
#include <SDL_mixer.h>
#include <SDL_pixels.h>
#include <SDL_rect.h>
#include <SDL_render.h>
#include <SDL_timer.h>
#include <cerrno>
#include <chrono>
#include <cstring>
#include <iostream>
#include <stdexcept>
#include <utility>
namespace {

View File

@@ -25,11 +25,13 @@ SOFTWARE.
#include "config.h"
#include <SDL.h>
#include <SDL_rect.h>
#include <SDL_render.h>
#include <array>
#include <atomic>
#include <condition_variable>
#include <memory>
#include <mutex>
#include <queue>
#include <string>
@@ -45,11 +47,12 @@ extern "C" {
#endif
#include <libavcodec/avcodec.h>
#include <libavformat/avformat.h>
#include <libavutil/avutil.h>
#include <libavutil/avutil.h> // IWYU pragma: keep
#include <libswresample/swresample.h>
#include <libswscale/swscale.h>
}
struct SwsContext;
#if LIBAVCODEC_VERSION_INT < AV_VERSION_INT(59, 0, 100)
using av_codec_ptr = AVCodec*;
#else

View File

@@ -26,12 +26,15 @@ SOFTWARE.
#include <cmath>
#include <cstdlib>
#include <queue>
#include <initializer_list>
#include <list>
#include <new>
#include <stdexcept>
#include <vector>
#include "lua.hpp"
#include "persist_lua.h"
#include "th_map.h"
abstract_pathfinder::abstract_pathfinder(pathfinder* pf) : parent(pf) {}

View File

@@ -22,11 +22,20 @@ SOFTWARE.
#ifndef CORSIX_TH_TH_PATHFIND_H_
#define CORSIX_TH_TH_PATHFIND_H_
#include "th_map.h"
#include "config.h"
#include <cstdint>
#include <vector>
#include "lua.hpp"
class level_map;
class lua_persist_reader;
class lua_persist_writer;
class pathfinder;
enum class object_type : uint8_t;
struct map_tile_flags;
/** Directions of movement. */
enum class travel_direction {

View File

@@ -24,11 +24,16 @@ SOFTWARE.
#include "config.h"
#include <SDL_rwops.h>
#include <cmath>
#include <cstring>
#include <new>
#include "th.h"
#ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_mixer.h>
#endif
sound_archive::sound_archive() {
sound_files = nullptr;

View File

@@ -24,7 +24,7 @@ SOFTWARE.
#define CORSIX_TH_TH_SOUND_H_
#include "config.h"
#include <SDL.h>
#include <SDL_rwops.h>
#ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_mixer.h>
#endif

View File

@@ -24,7 +24,6 @@ SOFTWARE.
#ifdef CORSIX_TH_USE_SDL_MIXER
#include <algorithm>
#include <cstring>
#include <iterator>
#include <new>
#include <vector>

View File

@@ -27,9 +27,9 @@ SOFTWARE.
#include <SDL.h>
#include <cstdio>
#include <stack>
#include "../Src/bootstrap.h"
#include "../Src/lua.hpp"
#ifdef CORSIX_TH_USE_SDL_MIXER
#include <SDL_mixer.h>
#endif

View File

@@ -38,7 +38,6 @@ SOFTWARE.
#include <cstddef>
#include <cstdint>
#include <vector>
static const std::uint32_t rnc_signature = 0x524E4301; /*!< "RNC\001" */

View File

@@ -20,6 +20,7 @@ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
*/
#include <cstdint>
#include <cstdio>
#include <cstdlib>
#include <cstring>