From f16bb61c9db225d3662561ab934e42980600e217 Mon Sep 17 00:00:00 2001 From: odrling Date: Thu, 28 Sep 2023 06:52:50 +0200 Subject: [PATCH] add missing includes fixes issues when building with LTO --- libaegisub/ass/dialogue_parser.cpp | 2 ++ libaegisub/ass/uuencode.cpp | 1 + libaegisub/common/cajun/reader.cpp | 1 + libaegisub/common/calltip_provider.cpp | 1 + libaegisub/common/character_count.cpp | 2 ++ libaegisub/common/mru.cpp | 2 ++ libaegisub/include/libaegisub/file_mapping.h | 1 + libaegisub/include/libaegisub/lua/ffi.h | 1 + libaegisub/unix/path.cpp | 2 ++ src/aegisublocale.cpp | 1 + src/audio_player.cpp | 3 +++ src/audio_player_alsa.cpp | 2 ++ src/audio_player_dsound.cpp | 2 ++ src/audio_player_dsound2.cpp | 2 ++ src/audio_player_openal.cpp | 2 ++ src/audio_player_oss.cpp | 2 ++ src/audio_player_portaudio.cpp | 2 ++ src/audio_player_portaudio.h | 2 ++ src/audio_player_pulse.cpp | 2 ++ src/audio_player_xaudio2.cpp | 2 ++ src/audio_provider_avs.cpp | 2 ++ src/audio_provider_bestsource.cpp | 5 ++++- src/audio_provider_factory.cpp | 4 ++++ src/audio_provider_ffmpegsource.cpp | 2 ++ src/audio_provider_vs.cpp | 2 ++ src/base_grid.h | 3 ++- src/bestsource_common.cpp | 4 ++++ src/bestsource_common.h | 5 +++++ src/colour_button.cpp | 1 + src/command/command.cpp | 1 + src/command/command.h | 2 ++ src/dialog_align.cpp | 1 + src/dialog_colorpicker.cpp | 1 + src/dialog_dummy_video.cpp | 1 + src/ffmpegsource_common.cpp | 2 ++ src/ffmpegsource_common.h | 3 +++ src/frame_main.cpp | 1 + src/image_position_picker.h | 1 + src/main.h | 2 ++ src/preferences.cpp | 1 + src/preferences_base.h | 1 + src/spline_curve.cpp | 1 + src/subtitles_provider_csri.cpp | 2 ++ src/utils.cpp | 4 +++- src/utils.h | 1 + src/video_frame.cpp | 1 + src/video_frame.h | 6 +++--- src/video_provider_avs.cpp | 2 ++ src/video_provider_bestsource.cpp | 5 +++++ src/video_provider_ffmpegsource.cpp | 5 +++++ src/video_provider_manager.cpp | 2 ++ src/video_provider_vs.cpp | 2 ++ src/visual_tool.cpp | 1 + src/visual_tool.h | 1 + tests/tests/character_count.cpp | 2 ++ 55 files changed, 109 insertions(+), 6 deletions(-) diff --git a/libaegisub/ass/dialogue_parser.cpp b/libaegisub/ass/dialogue_parser.cpp index 554395fa3..30f6f48fd 100644 --- a/libaegisub/ass/dialogue_parser.cpp +++ b/libaegisub/ass/dialogue_parser.cpp @@ -22,6 +22,8 @@ #include #include +#include + namespace { typedef std::vector TokenVec; diff --git a/libaegisub/ass/uuencode.cpp b/libaegisub/ass/uuencode.cpp index 182472926..33d51210e 100644 --- a/libaegisub/ass/uuencode.cpp +++ b/libaegisub/ass/uuencode.cpp @@ -16,6 +16,7 @@ #include +#include #include // Despite being called uuencoding by ass_specs.doc, the format is actually diff --git a/libaegisub/common/cajun/reader.cpp b/libaegisub/common/cajun/reader.cpp index 6f32d2ff4..3c0fa9222 100644 --- a/libaegisub/common/cajun/reader.cpp +++ b/libaegisub/common/cajun/reader.cpp @@ -10,6 +10,7 @@ Author: Terry Caton #include #include +#include /* diff --git a/libaegisub/common/calltip_provider.cpp b/libaegisub/common/calltip_provider.cpp index de693e637..a513316ec 100644 --- a/libaegisub/common/calltip_provider.cpp +++ b/libaegisub/common/calltip_provider.cpp @@ -18,6 +18,7 @@ #include "libaegisub/ass/dialogue_parser.h" +#include #include namespace { diff --git a/libaegisub/common/character_count.cpp b/libaegisub/common/character_count.cpp index 4563157a1..74bb89667 100644 --- a/libaegisub/common/character_count.cpp +++ b/libaegisub/common/character_count.cpp @@ -22,6 +22,8 @@ #include #include +#include +#include #include #include diff --git a/libaegisub/common/mru.cpp b/libaegisub/common/mru.cpp index dd7cfde92..a0d4aa80e 100644 --- a/libaegisub/common/mru.cpp +++ b/libaegisub/common/mru.cpp @@ -22,6 +22,8 @@ #include "libaegisub/option.h" #include "libaegisub/option_value.h" +#include + namespace { const char *mru_names[] = { "Audio", diff --git a/libaegisub/include/libaegisub/file_mapping.h b/libaegisub/include/libaegisub/file_mapping.h index dde241f38..95964174d 100644 --- a/libaegisub/include/libaegisub/file_mapping.h +++ b/libaegisub/include/libaegisub/file_mapping.h @@ -18,6 +18,7 @@ #include #include +#include namespace agi { // boost::interprocess::file_mapping is awesome and uses CreateFileA on Windows diff --git a/libaegisub/include/libaegisub/lua/ffi.h b/libaegisub/include/libaegisub/lua/ffi.h index 848cf0805..02e38ec21 100644 --- a/libaegisub/include/libaegisub/lua/ffi.h +++ b/libaegisub/include/libaegisub/lua/ffi.h @@ -18,6 +18,7 @@ #include #include +#include namespace agi { namespace lua { void do_register_lib_function(lua_State *L, const char *name, const char *type_name, void *func); diff --git a/libaegisub/unix/path.cpp b/libaegisub/unix/path.cpp index 7a2c9a465..78a1bfa14 100644 --- a/libaegisub/unix/path.cpp +++ b/libaegisub/unix/path.cpp @@ -22,6 +22,8 @@ #include #include +#include "../../acconf.h" + #ifndef __APPLE__ #include #include diff --git a/src/aegisublocale.cpp b/src/aegisublocale.cpp index cc5f4e10d..0266e3b2f 100644 --- a/src/aegisublocale.cpp +++ b/src/aegisublocale.cpp @@ -37,6 +37,7 @@ #include "compat.h" #include "options.h" #include "utils.h" +#include "acconf.h" #include diff --git a/src/audio_player.cpp b/src/audio_player.cpp index c46ba0a40..6345aa506 100644 --- a/src/audio_player.cpp +++ b/src/audio_player.cpp @@ -37,6 +37,9 @@ #include "audio_controller.h" #include "factory_manager.h" #include "options.h" +#include "acconf.h" + +#include #include diff --git a/src/audio_player_alsa.cpp b/src/audio_player_alsa.cpp index 9772d874d..595afb65f 100644 --- a/src/audio_player_alsa.cpp +++ b/src/audio_player_alsa.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_ALSA #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_dsound.cpp b/src/audio_player_dsound.cpp index 8b50492a0..c9455d907 100644 --- a/src/audio_player_dsound.cpp +++ b/src/audio_player_dsound.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_DIRECTSOUND #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_dsound2.cpp b/src/audio_player_dsound2.cpp index ad9149803..5900fc9e2 100644 --- a/src/audio_player_dsound2.cpp +++ b/src/audio_player_dsound2.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_DIRECTSOUND #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_openal.cpp b/src/audio_player_openal.cpp index 521e043ae..503ab4eec 100644 --- a/src/audio_player_openal.cpp +++ b/src/audio_player_openal.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_OPENAL #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_oss.cpp b/src/audio_player_oss.cpp index 0934ce197..a3a0b5c0f 100644 --- a/src/audio_player_oss.cpp +++ b/src/audio_player_oss.cpp @@ -30,6 +30,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_OSS #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_portaudio.cpp b/src/audio_player_portaudio.cpp index 1ee46110a..c6c47cc8b 100644 --- a/src/audio_player_portaudio.cpp +++ b/src/audio_player_portaudio.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_PORTAUDIO #include "audio_player_portaudio.h" diff --git a/src/audio_player_portaudio.h b/src/audio_player_portaudio.h index 77c292404..e7f256f19 100644 --- a/src/audio_player_portaudio.h +++ b/src/audio_player_portaudio.h @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_PORTAUDIO #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_pulse.cpp b/src/audio_player_pulse.cpp index 5b898b1df..cf584cbf5 100644 --- a/src/audio_player_pulse.cpp +++ b/src/audio_player_pulse.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_output /// +#include "acconf.h" + #ifdef WITH_LIBPULSE #include "include/aegisub/audio_player.h" diff --git a/src/audio_player_xaudio2.cpp b/src/audio_player_xaudio2.cpp index a7cbf0f28..d5e9f3122 100644 --- a/src/audio_player_xaudio2.cpp +++ b/src/audio_player_xaudio2.cpp @@ -27,6 +27,8 @@ // // Aegisub Project http://www.aegisub.org/ +#include "acconf.h" + #ifdef WITH_XAUDIO2 #include "include/aegisub/audio_player.h" diff --git a/src/audio_provider_avs.cpp b/src/audio_provider_avs.cpp index b5b1d0916..0e6ae0acb 100644 --- a/src/audio_provider_avs.cpp +++ b/src/audio_provider_avs.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_input /// +#include "acconf.h" + #ifdef WITH_AVISYNTH #include diff --git a/src/audio_provider_bestsource.cpp b/src/audio_provider_bestsource.cpp index df68fda63..4b4afa97d 100644 --- a/src/audio_provider_bestsource.cpp +++ b/src/audio_provider_bestsource.cpp @@ -19,6 +19,8 @@ /// @ingroup audio_input bestsource /// +#include "acconf.h" + #ifdef WITH_BESTSOURCE #include @@ -36,6 +38,8 @@ #include +#include + namespace { class BSAudioProvider final : public agi::AudioProvider { std::map bsopts; @@ -105,4 +109,3 @@ std::unique_ptr CreateBSAudioProvider(agi::fs::path const& f } #endif /* WITH_BESTSOURCE */ - diff --git a/src/audio_provider_factory.cpp b/src/audio_provider_factory.cpp index 3af069c3b..205b954e1 100644 --- a/src/audio_provider_factory.cpp +++ b/src/audio_provider_factory.cpp @@ -29,6 +29,10 @@ #include +#include + +#include "acconf.h" + using namespace agi; std::unique_ptr CreateAvisynthAudioProvider(fs::path const& filename, BackgroundRunner *); diff --git a/src/audio_provider_ffmpegsource.cpp b/src/audio_provider_ffmpegsource.cpp index a36f04743..ba1223a14 100644 --- a/src/audio_provider_ffmpegsource.cpp +++ b/src/audio_provider_ffmpegsource.cpp @@ -32,6 +32,8 @@ /// @ingroup audio_input ffms /// +#include "acconf.h" + #ifdef WITH_FFMS2 #include diff --git a/src/audio_provider_vs.cpp b/src/audio_provider_vs.cpp index 4bc337933..2a2f79c31 100644 --- a/src/audio_provider_vs.cpp +++ b/src/audio_provider_vs.cpp @@ -19,6 +19,8 @@ /// @ingroup audio_input /// +#include "acconf.h" + #ifdef WITH_VAPOURSYNTH #include diff --git a/src/base_grid.h b/src/base_grid.h index 3349b03c7..70a2cc14f 100644 --- a/src/base_grid.h +++ b/src/base_grid.h @@ -30,9 +30,10 @@ #include #include -#include #include #include +#include +#include namespace agi { struct Context; diff --git a/src/bestsource_common.cpp b/src/bestsource_common.cpp index 9e44daf68..a7e0949f6 100644 --- a/src/bestsource_common.cpp +++ b/src/bestsource_common.cpp @@ -19,6 +19,8 @@ /// @ingroup video_input audio_input ffms /// +#include "acconf.h" + #ifdef WITH_BESTSOURCE #include "bestsource_common.h" #include "tracklist.h" @@ -37,6 +39,8 @@ extern "C" { #include #include +#include + namespace provider_bs { std::pair SelectTrack(agi::fs::path const& filename, bool audio) { diff --git a/src/bestsource_common.h b/src/bestsource_common.h index a7892d39f..db3335551 100644 --- a/src/bestsource_common.h +++ b/src/bestsource_common.h @@ -19,8 +19,13 @@ /// @ingroup video_input audio_input ffms /// +#include "acconf.h" + #ifdef WITH_BESTSOURCE +#include +#include + #include #include diff --git a/src/colour_button.cpp b/src/colour_button.cpp index 48a87856c..5a57f7b6b 100644 --- a/src/colour_button.cpp +++ b/src/colour_button.cpp @@ -18,6 +18,7 @@ #include "dialogs.h" +#include #include AGI_DEFINE_EVENT(EVT_COLOR, agi::Color); diff --git a/src/command/command.cpp b/src/command/command.cpp index d0419161c..009749c6f 100644 --- a/src/command/command.cpp +++ b/src/command/command.cpp @@ -22,6 +22,7 @@ #include #include "include/aegisub/hotkey.h" +#include #include namespace cmd { diff --git a/src/command/command.h b/src/command/command.h index 899cace05..c88da26a7 100644 --- a/src/command/command.h +++ b/src/command/command.h @@ -28,6 +28,8 @@ #include +#include + namespace agi { struct Context; } #define CMD_NAME(a) const char* name() const override { return a; } diff --git a/src/dialog_align.cpp b/src/dialog_align.cpp index 93e506636..9ed62d7f2 100644 --- a/src/dialog_align.cpp +++ b/src/dialog_align.cpp @@ -51,6 +51,7 @@ #include #include #include +#include #if BOOST_VERSION >= 106900 #include #else diff --git a/src/dialog_colorpicker.cpp b/src/dialog_colorpicker.cpp index 3aee645ca..f69a330d0 100644 --- a/src/dialog_colorpicker.cpp +++ b/src/dialog_colorpicker.cpp @@ -41,6 +41,7 @@ #include #include +#include #include #include diff --git a/src/dialog_dummy_video.cpp b/src/dialog_dummy_video.cpp index 833c84f0b..974f2ed42 100644 --- a/src/dialog_dummy_video.cpp +++ b/src/dialog_dummy_video.cpp @@ -22,6 +22,7 @@ #include "options.h" #include "validators.h" #include "video_provider_dummy.h" +#include "wx/valtext.h" #include #include diff --git a/src/ffmpegsource_common.cpp b/src/ffmpegsource_common.cpp index 3ffa7f4fb..14bdc031e 100644 --- a/src/ffmpegsource_common.cpp +++ b/src/ffmpegsource_common.cpp @@ -32,6 +32,8 @@ /// @ingroup video_input audio_input ffms /// +#include "acconf.h" + #ifdef WITH_FFMS2 #include "ffmpegsource_common.h" diff --git a/src/ffmpegsource_common.h b/src/ffmpegsource_common.h index 383d5baa2..802509fea 100644 --- a/src/ffmpegsource_common.h +++ b/src/ffmpegsource_common.h @@ -32,6 +32,8 @@ /// @ingroup video_input audio_input ffms /// +#include "acconf.h" + #ifdef WITH_FFMS2 #include @@ -39,6 +41,7 @@ #include #include +#include namespace agi { class BackgroundRunner; } diff --git a/src/frame_main.cpp b/src/frame_main.cpp index 6e6efe7a2..9292d293c 100644 --- a/src/frame_main.cpp +++ b/src/frame_main.cpp @@ -68,6 +68,7 @@ #include #include #include +#include enum { ID_APP_TIMER_STATUSCLEAR = 12002 diff --git a/src/image_position_picker.h b/src/image_position_picker.h index 1f808db39..9551189bf 100644 --- a/src/image_position_picker.h +++ b/src/image_position_picker.h @@ -1,6 +1,7 @@ #include #include #include "gl_wrap.h" +#include typedef std::function updator; diff --git a/src/main.h b/src/main.h index de65b65da..35b7be1c9 100644 --- a/src/main.h +++ b/src/main.h @@ -31,6 +31,8 @@ #include "aegisublocale.h" +#include + #ifndef wxUSE_EXCEPTIONS #error wxWidgets is compiled without exceptions support. Aegisub requires exceptions support in wxWidgets to run safely. #endif diff --git a/src/preferences.cpp b/src/preferences.cpp index bfce6a5ee..c0625d618 100644 --- a/src/preferences.cpp +++ b/src/preferences.cpp @@ -47,6 +47,7 @@ #include #include +#include #include #include #include diff --git a/src/preferences_base.h b/src/preferences_base.h index 3bf098f64..0770d7d64 100644 --- a/src/preferences_base.h +++ b/src/preferences_base.h @@ -19,6 +19,7 @@ #include #include +#include class Preferences; class wxControl; diff --git a/src/spline_curve.cpp b/src/spline_curve.cpp index e59010124..581067932 100644 --- a/src/spline_curve.cpp +++ b/src/spline_curve.cpp @@ -36,6 +36,7 @@ #include "utils.h" #include +#include SplineCurve::SplineCurve(Vector2D p1) : p1(p1), type(POINT) { } SplineCurve::SplineCurve(Vector2D p1, Vector2D p2) : p1(p1), p2(p2), type(LINE) { } diff --git a/src/subtitles_provider_csri.cpp b/src/subtitles_provider_csri.cpp index 87429e213..877fe663e 100644 --- a/src/subtitles_provider_csri.cpp +++ b/src/subtitles_provider_csri.cpp @@ -32,6 +32,8 @@ /// @ingroup subtitle_rendering /// +#include "acconf.h" + #ifdef WITH_CSRI #include "subtitles_provider_csri.h" diff --git a/src/utils.cpp b/src/utils.cpp index ded081e4a..7bb54af3e 100644 --- a/src/utils.cpp +++ b/src/utils.cpp @@ -38,6 +38,8 @@ #include #include +#include + #ifdef __UNIX__ #include #endif @@ -181,7 +183,7 @@ void CleanCache(agi::fs::path const& directory, std::string const& file_type, ui return; } - sort(begin(cachefiles), end(cachefiles), [](cache_item const& a, cache_item const& b) { + std::sort(begin(cachefiles), end(cachefiles), [](cache_item const& a, cache_item const& b) { return a.first < b.first; }); diff --git a/src/utils.h b/src/utils.h index 88280997f..f38598188 100644 --- a/src/utils.h +++ b/src/utils.h @@ -34,6 +34,7 @@ #include #include +#include #include #include diff --git a/src/video_frame.cpp b/src/video_frame.cpp index bb5f59762..a2a656b25 100644 --- a/src/video_frame.cpp +++ b/src/video_frame.cpp @@ -16,6 +16,7 @@ #include "video_frame.h" +#include #include #include diff --git a/src/video_frame.h b/src/video_frame.h index 28148368d..d03b8e395 100644 --- a/src/video_frame.h +++ b/src/video_frame.h @@ -22,9 +22,9 @@ class wxImage; struct VideoFrame { std::vector data; - size_t width; - size_t height; - size_t pitch; + std::size_t width; + std::size_t height; + std::size_t pitch; bool flipped; }; diff --git a/src/video_provider_avs.cpp b/src/video_provider_avs.cpp index 0c824f264..49a96a7f5 100644 --- a/src/video_provider_avs.cpp +++ b/src/video_provider_avs.cpp @@ -27,6 +27,8 @@ // // Aegisub Project http://www.aegisub.org/ +#include "acconf.h" + #ifdef WITH_AVISYNTH #include "include/aegisub/video_provider.h" diff --git a/src/video_provider_bestsource.cpp b/src/video_provider_bestsource.cpp index d640d7008..2c3cff8c9 100644 --- a/src/video_provider_bestsource.cpp +++ b/src/video_provider_bestsource.cpp @@ -19,6 +19,8 @@ /// @ingroup video_input bestsource /// +#include "acconf.h" + #ifdef WITH_BESTSOURCE #include "include/aegisub/video_provider.h" @@ -46,6 +48,9 @@ namespace agi { class BackgroundRunner; } #include #include +#include +#include + namespace { /// @class BSVideoProvider diff --git a/src/video_provider_ffmpegsource.cpp b/src/video_provider_ffmpegsource.cpp index 35507b6e2..61580e408 100644 --- a/src/video_provider_ffmpegsource.cpp +++ b/src/video_provider_ffmpegsource.cpp @@ -32,6 +32,8 @@ /// @ingroup video_input ffms /// +#include "acconf.h" + #ifdef WITH_FFMS2 #include "ffmpegsource_common.h" #include "include/aegisub/video_provider.h" @@ -43,6 +45,9 @@ #include #include +#include +#include + namespace { /// @class FFmpegSourceVideoProvider /// @brief Implements video loading through the FFMS library. diff --git a/src/video_provider_manager.cpp b/src/video_provider_manager.cpp index dfe7d3a76..27bf1e68c 100644 --- a/src/video_provider_manager.cpp +++ b/src/video_provider_manager.cpp @@ -29,6 +29,8 @@ #include +#include "acconf.h" + std::unique_ptr CreateDummyVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *); std::unique_ptr CreateYUV4MPEGVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *); std::unique_ptr CreateFFmpegSourceVideoProvider(agi::fs::path const&, std::string const&, agi::BackgroundRunner *); diff --git a/src/video_provider_vs.cpp b/src/video_provider_vs.cpp index 153f1e649..d4438b835 100644 --- a/src/video_provider_vs.cpp +++ b/src/video_provider_vs.cpp @@ -14,6 +14,8 @@ // // Aegisub Project http://www.aegisub.org/ +#include "acconf.h" + #ifdef WITH_VAPOURSYNTH #include "include/aegisub/video_provider.h" diff --git a/src/visual_tool.cpp b/src/visual_tool.cpp index 0f8824a65..ff1e20ade 100644 --- a/src/visual_tool.cpp +++ b/src/visual_tool.cpp @@ -45,6 +45,7 @@ #include #include +#include VisualToolBase::VisualToolBase(VideoDisplay *parent, agi::Context *context) : c(context) diff --git a/src/visual_tool.h b/src/visual_tool.h index c139c1733..2430b93a7 100644 --- a/src/visual_tool.h +++ b/src/visual_tool.h @@ -23,6 +23,7 @@ #include "gl_wrap.h" #include "vector2d.h" #include "options.h" +#include #include #include diff --git a/tests/tests/character_count.cpp b/tests/tests/character_count.cpp index 36d3e948b..13e974c40 100644 --- a/tests/tests/character_count.cpp +++ b/tests/tests/character_count.cpp @@ -19,6 +19,8 @@ #include +#include + TEST(lagi_character_count, basic) { EXPECT_EQ(5, agi::CharacterCount("hello", agi::IGNORE_NONE)); }