diff --git a/core/config/project_settings.cpp b/core/config/project_settings.cpp index bed2f08cbc..ff111b1fad 100644 --- a/core/config/project_settings.cpp +++ b/core/config/project_settings.cpp @@ -30,8 +30,8 @@ #include "project_settings.h" -#include "core/core_bind.h" // For Compression enum. #include "core/input/input_map.h" +#include "core/io/compression.h" #include "core/io/config_file.h" #include "core/io/dir_access.h" #include "core/io/file_access.h" @@ -50,7 +50,7 @@ #ifdef TOOLS_ENABLED #include "core/config/engine.h" -#include "modules/modules_enabled.gen.h" // For mono. +#include "modules/modules_enabled.gen.h" // IWYU pragma: keep. For mono. #endif // TOOLS_ENABLED ProjectSettings *ProjectSettings::get_singleton() { diff --git a/core/config/project_settings.h b/core/config/project_settings.h index 6b30ab0659..e197a8d93b 100644 --- a/core/config/project_settings.h +++ b/core/config/project_settings.h @@ -31,6 +31,7 @@ #pragma once #include "core/object/object.h" +#include "core/os/thread_safe.h" #include "core/templates/rb_map.h" template diff --git a/core/core_builders.py b/core/core_builders.py index bfae638a64..c9d76eb068 100644 --- a/core/core_builders.py +++ b/core/core_builders.py @@ -63,7 +63,7 @@ def encryption_key_builder(target, source, env): with methods.generated_wrapper(str(target[0])) as file: file.write( f"""\ -#include "core/config/project_settings.h" +#include uint8_t script_encryption_key[32] = {{ {methods.format_buffer(buffer, 1)} diff --git a/core/core_constants.cpp b/core/core_constants.cpp index 7c6d99c1cc..b99da1fe2d 100644 --- a/core/core_constants.cpp +++ b/core/core_constants.cpp @@ -30,10 +30,13 @@ #include "core_constants.h" -#include "core/input/input_event.h" -#include "core/object/class_db.h" +#include "core/input/input_enums.h" +#include "core/object/method_bind.h" // IWYU pragma: keep. To bind `MethodFlags`. +#include "core/object/object.h" #include "core/os/keyboard.h" +#include "core/variant/type_info.h" #include "core/variant/variant.h" +#include "core/variant/variant_caster.h" struct _CoreConstant { #ifdef DEBUG_ENABLED diff --git a/core/crypto/crypto_core.cpp b/core/crypto/crypto_core.cpp index 9d2c346e3a..1c7d5d0790 100644 --- a/core/crypto/crypto_core.cpp +++ b/core/crypto/crypto_core.cpp @@ -31,6 +31,7 @@ #include "crypto_core.h" #include "core/os/os.h" +#include "core/string/ustring.h" #include #include diff --git a/core/crypto/crypto_core.h b/core/crypto/crypto_core.h index 8ef50fbcf7..a061a74387 100644 --- a/core/crypto/crypto_core.h +++ b/core/crypto/crypto_core.h @@ -30,7 +30,12 @@ #pragma once -#include "core/object/ref_counted.h" +#include "core/error/error_list.h" + +#include +#include + +class String; class CryptoCore { public: diff --git a/core/debugger/engine_profiler.cpp b/core/debugger/engine_profiler.cpp index 613525f0e7..d93a367f15 100644 --- a/core/debugger/engine_profiler.cpp +++ b/core/debugger/engine_profiler.cpp @@ -31,7 +31,7 @@ #include "engine_profiler.h" #include "core/debugger/engine_debugger.h" -#include "core/object/class_db.h" +#include "core/object/class_db.h" // IWYU pragma: keep. `GDVIRTUAL_BIND` macro. void EngineProfiler::_bind_methods() { GDVIRTUAL_BIND(_toggle, "enable", "options"); diff --git a/core/debugger/local_debugger.h b/core/debugger/local_debugger.h index 5c603e5f86..91c8d8be40 100644 --- a/core/debugger/local_debugger.h +++ b/core/debugger/local_debugger.h @@ -31,7 +31,6 @@ #pragma once #include "core/debugger/engine_debugger.h" -#include "core/object/script_language.h" #include "core/templates/list.h" class LocalDebugger : public EngineDebugger { diff --git a/core/debugger/remote_debugger.h b/core/debugger/remote_debugger.h index 8ecc1c483f..9c64342a02 100644 --- a/core/debugger/remote_debugger.h +++ b/core/debugger/remote_debugger.h @@ -33,7 +33,6 @@ #include "core/debugger/debugger_marshalls.h" #include "core/debugger/engine_debugger.h" #include "core/debugger/remote_debugger_peer.h" -#include "core/string/string_name.h" #include "core/string/ustring.h" #include "core/variant/array.h" diff --git a/core/debugger/remote_debugger_peer.cpp b/core/debugger/remote_debugger_peer.cpp index 759394a2a5..19dea3ec04 100644 --- a/core/debugger/remote_debugger_peer.cpp +++ b/core/debugger/remote_debugger_peer.cpp @@ -32,6 +32,9 @@ #include "core/config/project_settings.h" #include "core/io/marshalls.h" +#include "core/io/stream_peer_socket.h" +#include "core/io/stream_peer_tcp.h" +#include "core/io/stream_peer_uds.h" #include "core/os/os.h" bool RemoteDebuggerPeerTCP::is_peer_connected() { diff --git a/core/debugger/remote_debugger_peer.h b/core/debugger/remote_debugger_peer.h index 6942c09bf9..dec7d91106 100644 --- a/core/debugger/remote_debugger_peer.h +++ b/core/debugger/remote_debugger_peer.h @@ -30,13 +30,13 @@ #pragma once -#include "core/io/stream_peer_tcp.h" -#include "core/io/stream_peer_uds.h" #include "core/object/ref_counted.h" #include "core/os/mutex.h" #include "core/os/thread.h" #include "core/string/ustring.h" +class StreamPeerSocket; + class RemoteDebuggerPeer : public RefCounted { GDSOFTCLASS(RemoteDebuggerPeer, RefCounted); diff --git a/core/doc_data.cpp b/core/doc_data.cpp index 92de0a8070..9cd8e51b61 100644 --- a/core/doc_data.cpp +++ b/core/doc_data.cpp @@ -30,6 +30,8 @@ #include "doc_data.h" +#include "core/object/object.h" + String DocData::get_default_value_string(const Variant &p_value) { const Variant::Type type = p_value.get_type(); if (type == Variant::ARRAY) { diff --git a/core/doc_data.h b/core/doc_data.h index 80b7fa2382..c0aa165212 100644 --- a/core/doc_data.h +++ b/core/doc_data.h @@ -30,7 +30,6 @@ #pragma once -#include "core/io/xml_parser.h" #include "core/variant/variant.h" class DocData { diff --git a/core/extension/extension_api_dump.h b/core/extension/extension_api_dump.h index 027a8d916e..1f6e1de454 100644 --- a/core/extension/extension_api_dump.h +++ b/core/extension/extension_api_dump.h @@ -30,14 +30,17 @@ #pragma once -#include "core/extension/gdextension.h" - #ifdef TOOLS_ENABLED +#include "core/error/error_list.h" +#include "core/string/ustring.h" +#include "core/variant/dictionary.h" + class GDExtensionAPIDump { public: static Dictionary generate_extension_api(bool p_include_docs = false); static void generate_extension_json_file(const String &p_path, bool p_include_docs = false); static Error validate_extension_json_file(const String &p_path); }; + #endif diff --git a/core/extension/gdextension.h b/core/extension/gdextension.h index 2f0835a0d2..8bf3ebe6c3 100644 --- a/core/extension/gdextension.h +++ b/core/extension/gdextension.h @@ -32,7 +32,6 @@ #include "core/extension/gdextension_interface.gen.h" #include "core/extension/gdextension_loader.h" -#include "core/io/config_file.h" #include "core/io/resource_loader.h" #include "core/object/ref_counted.h" diff --git a/core/extension/gdextension_function_loader.h b/core/extension/gdextension_function_loader.h index febda097ca..5635a24d01 100644 --- a/core/extension/gdextension_function_loader.h +++ b/core/extension/gdextension_function_loader.h @@ -31,7 +31,6 @@ #pragma once #include "core/extension/gdextension_loader.h" -#include "core/os/shared_object.h" class GDExtension; diff --git a/core/io/compression.cpp b/core/io/compression.cpp index aeed0d272b..72d2e1b222 100644 --- a/core/io/compression.cpp +++ b/core/io/compression.cpp @@ -30,7 +30,6 @@ #include "compression.h" -#include "core/config/project_settings.h" #include "core/io/zip_io.h" #include "thirdparty/misc/fastlz.h" diff --git a/core/io/delta_encoding.cpp b/core/io/delta_encoding.cpp index 9b5242a60e..d4db12a467 100644 --- a/core/io/delta_encoding.cpp +++ b/core/io/delta_encoding.cpp @@ -30,6 +30,10 @@ #include "delta_encoding.h" +#include "core/error/error_list.h" +#include "core/templates/vector.h" +#include "core/variant/variant.h" // vformat + #include #define ERR_FAIL_ZSTD_V_MSG(m_result, m_retval, m_msg) \ diff --git a/core/io/delta_encoding.h b/core/io/delta_encoding.h index 835f1e8409..7d2253055e 100644 --- a/core/io/delta_encoding.h +++ b/core/io/delta_encoding.h @@ -30,7 +30,12 @@ #pragma once -#include "core/io/file_access.h" +#include "core/templates/span.h" + +#include + +template +class Vector; class DeltaEncoding { public: diff --git a/core/io/dtls_server.h b/core/io/dtls_server.h index 10965b3b88..416a76a067 100644 --- a/core/io/dtls_server.h +++ b/core/io/dtls_server.h @@ -30,7 +30,6 @@ #pragma once -#include "core/io/net_socket.h" #include "core/io/packet_peer_dtls.h" class DTLSServer : public RefCounted { diff --git a/core/io/http_client.h b/core/io/http_client.h index 54a3d9c436..d2da1e6a6f 100644 --- a/core/io/http_client.h +++ b/core/io/http_client.h @@ -31,9 +31,7 @@ #pragma once #include "core/crypto/crypto.h" -#include "core/io/ip.h" #include "core/io/stream_peer.h" -#include "core/io/stream_peer_tcp.h" #include "core/object/ref_counted.h" class HTTPClient : public RefCounted { diff --git a/core/io/http_client_tcp.cpp b/core/io/http_client_tcp.cpp index 68010fa2f7..13f487e13c 100644 --- a/core/io/http_client_tcp.cpp +++ b/core/io/http_client_tcp.cpp @@ -32,6 +32,7 @@ #include "http_client_tcp.h" +#include "core/io/stream_peer_tcp.h" #include "core/io/stream_peer_tls.h" #include "core/object/class_db.h" #include "core/os/os.h" diff --git a/core/io/http_client_tcp.h b/core/io/http_client_tcp.h index 84f9bcc16b..ae6f3b453a 100644 --- a/core/io/http_client_tcp.h +++ b/core/io/http_client_tcp.h @@ -33,6 +33,9 @@ #include "http_client.h" #include "core/crypto/crypto.h" +#include "core/io/ip.h" + +class StreamPeerTCP; class HTTPClientTCP : public HTTPClient { GDSOFTCLASS(HTTPClientTCP, HTTPClient); diff --git a/core/io/packet_peer_udp.h b/core/io/packet_peer_udp.h index 1c909860c5..ef005b0854 100644 --- a/core/io/packet_peer_udp.h +++ b/core/io/packet_peer_udp.h @@ -30,7 +30,7 @@ #pragma once -#include "core/io/ip.h" +#include "core/io/ip_address.h" #include "core/io/net_socket.h" #include "core/io/packet_peer.h" diff --git a/core/io/resource.cpp b/core/io/resource.cpp index a19f0d816f..d4cdee23cc 100644 --- a/core/io/resource.cpp +++ b/core/io/resource.cpp @@ -35,7 +35,7 @@ #include "core/math/random_pcg.h" #include "core/object/class_db.h" #include "core/os/os.h" -#include "core/variant/container_type_validate.h" +#include "core/variant/container_type_validate.h" // IWYU pragma: keep. #include "scene/main/node.h" //only so casting works void Resource::register_custom_data_to_otdb() { diff --git a/core/io/resource.h b/core/io/resource.h index b83badf030..dd432b9db7 100644 --- a/core/io/resource.h +++ b/core/io/resource.h @@ -30,7 +30,7 @@ #pragma once -#include "core/io/resource_uid.h" +#include "core/io/resource_uid.h" // IWYU pragma: export. Make available to all resources. #include "core/object/gdvirtual.gen.h" #include "core/object/ref_counted.h" #include "core/templates/self_list.h" diff --git a/core/io/stream_peer_gzip.h b/core/io/stream_peer_gzip.h index 9641f778b9..4d5a84f879 100644 --- a/core/io/stream_peer_gzip.h +++ b/core/io/stream_peer_gzip.h @@ -32,7 +32,6 @@ #include "core/io/stream_peer.h" -#include "core/io/compression.h" #include "core/templates/ring_buffer.h" class StreamPeerGZIP : public StreamPeer { diff --git a/core/io/stream_peer_tcp.h b/core/io/stream_peer_tcp.h index e472a46cf0..62f0f99e17 100644 --- a/core/io/stream_peer_tcp.h +++ b/core/io/stream_peer_tcp.h @@ -30,7 +30,6 @@ #pragma once -#include "core/io/ip.h" #include "core/io/ip_address.h" #include "core/io/stream_peer_socket.h" diff --git a/core/io/stream_peer_tls.cpp b/core/io/stream_peer_tls.cpp index 46b0f53195..3eb51c9b36 100644 --- a/core/io/stream_peer_tls.cpp +++ b/core/io/stream_peer_tls.cpp @@ -30,7 +30,6 @@ #include "stream_peer_tls.h" -#include "core/config/engine.h" #include "core/object/class_db.h" StreamPeerTLS *(*StreamPeerTLS::_create)(bool p_notify_postinitialize) = nullptr; diff --git a/core/io/tcp_server.h b/core/io/tcp_server.h index 4e3248a846..c1967b92e0 100644 --- a/core/io/tcp_server.h +++ b/core/io/tcp_server.h @@ -30,7 +30,7 @@ #pragma once -#include "core/io/ip.h" +#include "core/io/ip_address.h" #include "core/io/socket_server.h" #include "core/io/stream_peer_tcp.h" diff --git a/core/io/zip_io.h b/core/io/zip_io.h index 82004d9ca3..f4c00f2c03 100644 --- a/core/io/zip_io.h +++ b/core/io/zip_io.h @@ -32,11 +32,9 @@ #include "core/io/file_access.h" -// Not directly used in this header, but assumed available in downstream users -// like platform/*/export/export.cpp. Could be fixed, but probably better to have -// thirdparty includes in as little headers as possible. -#include "thirdparty/minizip/unzip.h" -#include "thirdparty/minizip/zip.h" +// This file serves as the Godot interface to minizip. +#include "thirdparty/minizip/unzip.h" // IWYU pragma: export +#include "thirdparty/minizip/zip.h" // IWYU pragma: export // Get the current file info and safely convert the full filepath to a String. int godot_unzip_get_current_file_info(unzFile p_zip_file, unz_file_info64 &r_file_info, String &r_filepath); diff --git a/core/math/bvh.h b/core/math/bvh.h index 5f0bf23f28..03a358f118 100644 --- a/core/math/bvh.h +++ b/core/math/bvh.h @@ -55,6 +55,8 @@ #include "core/math/geometry_3d.h" #include "core/os/mutex.h" +#include // INT_MAX + #define BVHTREE_CLASS BVH_Tree #define BVH_LOCKED_FUNCTION BVHLockedFunction _lock_guard(&_mutex, BVH_THREAD_SAFE &&_thread_safe); diff --git a/core/math/bvh_abb.h b/core/math/bvh_abb.h index b96ea0859a..cfb5ebd43e 100644 --- a/core/math/bvh_abb.h +++ b/core/math/bvh_abb.h @@ -32,6 +32,8 @@ #include "core/math/aabb.h" +#include // FLT_MAX + // special optimized version of axis aligned bounding box template struct BVH_ABB { diff --git a/core/math/bvh_tree.h b/core/math/bvh_tree.h index d33b8608ec..86daaab5ce 100644 --- a/core/math/bvh_tree.h +++ b/core/math/bvh_tree.h @@ -44,8 +44,6 @@ #include "core/templates/local_vector.h" #include "core/templates/pooled_list.h" -#include - #define BVHABB_CLASS BVH_ABB // not sure if this is better yet so making optional diff --git a/core/math/convex_hull.cpp b/core/math/convex_hull.cpp index 926fb0d28a..e72515c99c 100644 --- a/core/math/convex_hull.cpp +++ b/core/math/convex_hull.cpp @@ -64,6 +64,8 @@ subject to the following restrictions: #include "core/templates/a_hash_map.h" #include "core/templates/paged_allocator.h" +#include // FLT_MAX + //#define DEBUG_CONVEX_HULL //#define SHOW_ITERATIONS diff --git a/core/math/math_funcs.h b/core/math/math_funcs.h index 971ecd5aea..43e4aac4eb 100644 --- a/core/math/math_funcs.h +++ b/core/math/math_funcs.h @@ -34,7 +34,6 @@ #include "core/math/math_defs.h" #include "core/typedefs.h" -#include #include namespace Math { diff --git a/core/math/random_pcg.h b/core/math/random_pcg.h index bfcd3eeecc..618f3ebe76 100644 --- a/core/math/random_pcg.h +++ b/core/math/random_pcg.h @@ -34,6 +34,8 @@ #include "thirdparty/misc/pcg.h" +#include // ldexp + #if defined(__GNUC__) #define CLZ32(x) __builtin_clz(x) #elif defined(_MSC_VER) @@ -122,14 +124,14 @@ public: if (temp < CMP_EPSILON) { temp += CMP_EPSILON; // To prevent generating of INF value in log function, resulting to return NaN value from this function. } - return p_mean + p_deviation * (std::cos(Math::TAU * randd()) * std::sqrt(-2.0 * std::log(temp))); // Box-Muller transform. + return p_mean + p_deviation * (Math::cos(Math::TAU * randd()) * Math::sqrt(-2.0 * Math::log(temp))); // Box-Muller transform. } _FORCE_INLINE_ float randfn(float p_mean, float p_deviation) { float temp = randf(); if (temp < CMP_EPSILON) { temp += CMP_EPSILON; // To prevent generating of INF value in log function, resulting to return NaN value from this function. } - return p_mean + p_deviation * (std::cos((float)Math::TAU * randf()) * std::sqrt(-2.0 * std::log(temp))); // Box-Muller transform. + return p_mean + p_deviation * (Math::cos((float)Math::TAU * randf()) * Math::sqrt(-2.0 * Math::log(temp))); // Box-Muller transform. } double random(double p_from, double p_to); diff --git a/core/object/class_db.h b/core/object/class_db.h index 2596ae85fd..24072b36de 100644 --- a/core/object/class_db.h +++ b/core/object/class_db.h @@ -55,7 +55,7 @@ inline constexpr bool is_class_enabled_v = is_class_enabled::value; #define GD_IS_CLASS_ENABLED(m_class) is_class_enabled_v -#include "core/disabled_classes.gen.h" +#include "core/disabled_classes.gen.h" // IWYU pragma: keep. #define DEFVAL(m_defval) (m_defval) #define DEFVAL_ARRAY DEFVAL(ClassDB::default_array_arg) diff --git a/core/object/make_virtuals.py b/core/object/make_virtuals.py index fe47477085..7ba4c31e70 100644 --- a/core/object/make_virtuals.py +++ b/core/object/make_virtuals.py @@ -196,10 +196,12 @@ def run(target, source, env): txt = """/* THIS FILE IS GENERATED DO NOT EDIT */ #pragma once +// IWYU pragma: begin_keep #include "core/object/script_instance.h" #include "core/variant/method_ptrcall.h" #include "core/variant/variant_caster.h" #include "core/variant/variant_internal.h" +// IWYU pragma: end_keep inline constexpr uintptr_t _INVALID_GDVIRTUAL_FUNC_ADDR = static_cast(-1); diff --git a/core/object/message_queue.cpp b/core/object/message_queue.cpp index f5afc6f17e..5b97eb5f62 100644 --- a/core/object/message_queue.cpp +++ b/core/object/message_queue.cpp @@ -31,8 +31,6 @@ #include "message_queue.h" #include "core/config/project_settings.h" -#include "core/object/class_db.h" -#include "core/object/script_language.h" #include diff --git a/core/object/object.h b/core/object/object.h index aaf33f9c86..c6877981b0 100644 --- a/core/object/object.h +++ b/core/object/object.h @@ -33,8 +33,8 @@ #include "core/extension/gdextension_interface.gen.h" #include "core/object/gdtype.h" #include "core/object/object_id.h" +#include "core/os/mutex.h" #include "core/os/spin_lock.h" -#include "core/os/thread_safe.h" #include "core/templates/hash_map.h" #include "core/templates/hash_set.h" #include "core/templates/list.h" diff --git a/core/object/ref_counted.cpp b/core/object/ref_counted.cpp index a6834b1312..5980adfbec 100644 --- a/core/object/ref_counted.cpp +++ b/core/object/ref_counted.cpp @@ -31,7 +31,7 @@ #include "ref_counted.h" #include "core/object/class_db.h" -#include "core/object/script_language.h" +#include "core/object/script_instance.h" bool RefCounted::init_ref() { if (reference()) { diff --git a/core/object/script_language.cpp b/core/object/script_language.cpp index 275a95ad83..a8ee34a8f2 100644 --- a/core/object/script_language.cpp +++ b/core/object/script_language.cpp @@ -38,7 +38,6 @@ #include "core/io/resource_loader.h" #include "core/object/callable_mp.h" #include "core/object/class_db.h" -#include "core/os/os.h" #include "core/templates/sort_array.h" ScriptLanguage *ScriptServer::_languages[MAX_LANGUAGES]; diff --git a/core/object/worker_thread_pool.h b/core/object/worker_thread_pool.h index d774da3ac5..808be67a26 100644 --- a/core/object/worker_thread_pool.h +++ b/core/object/worker_thread_pool.h @@ -37,7 +37,6 @@ #include "core/os/thread.h" #include "core/templates/local_vector.h" #include "core/templates/paged_allocator.h" -#include "core/templates/rid.h" #include "core/templates/safe_refcount.h" #include "core/templates/self_list.h" #include "core/variant/callable.h" diff --git a/core/os/thread.cpp b/core/os/thread.cpp index 4b0390ce7f..860f2218e5 100644 --- a/core/os/thread.cpp +++ b/core/os/thread.cpp @@ -28,7 +28,7 @@ /* SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. */ /**************************************************************************/ -#include "platform_config.h" +#include "platform_config.h" // IWYU pragma: keep. Can override the implementation. #ifndef PLATFORM_THREAD_OVERRIDE // See details in thread.h. diff --git a/core/os/thread.h b/core/os/thread.h index 4e4a27ecc7..216433997a 100644 --- a/core/os/thread.h +++ b/core/os/thread.h @@ -30,7 +30,7 @@ #pragma once -#include "platform_config.h" +#include "platform_config.h" // IWYU pragma: keep. Can override the implementation. // Define PLATFORM_THREAD_OVERRIDE in your platform's `platform_config.h` // to use a custom Thread implementation defined in `platform/[your_platform]/platform_thread.h`. diff --git a/core/profiling/profiling.h b/core/profiling/profiling.h index 4928fb8a8d..9dea94043f 100644 --- a/core/profiling/profiling.h +++ b/core/profiling/profiling.h @@ -30,7 +30,7 @@ #pragma once -#include "profiling.gen.h" +#include "profiling.gen.h" // IWYU pragma: keep. // This header provides profiling primitives (implemented as macros) for various backends. // See the "No profiling" branch at the bottom for a short description of the functions. diff --git a/core/string/ustring.cpp b/core/string/ustring.cpp index 742a90d2a4..dfbc07b8b3 100644 --- a/core/string/ustring.cpp +++ b/core/string/ustring.cpp @@ -39,7 +39,6 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, Object); #include "core/math/color.h" #include "core/math/math_funcs.h" #include "core/object/object.h" -#include "core/os/memory.h" #include "core/os/os.h" #include "core/string/print_string.h" #include "core/string/string_name.h" diff --git a/core/templates/cowdata.h b/core/templates/cowdata.h index 9be5aa32f8..f2d6e5459a 100644 --- a/core/templates/cowdata.h +++ b/core/templates/cowdata.h @@ -32,7 +32,7 @@ #include "core/error/error_macros.h" #include "core/os/memory.h" -#include "core/string/print_string.h" +#include "core/string/print_string.h" // IWYU pragma: keep. `WARN_VERBOSE` macro. #include "core/templates/safe_refcount.h" #include "core/templates/span.h" diff --git a/core/templates/hash_map.h b/core/templates/hash_map.h index 3dbcae703f..62d6eb89b4 100644 --- a/core/templates/hash_map.h +++ b/core/templates/hash_map.h @@ -31,7 +31,7 @@ #pragma once #include "core/os/memory.h" -#include "core/string/print_string.h" +#include "core/string/print_string.h" // IWYU pragma: keep. `WARN_VERBOSE` macro. #include "core/templates/hashfuncs.h" #include "core/templates/pair.h" #include "core/templates/sort_list.h" diff --git a/core/templates/hash_set.h b/core/templates/hash_set.h index f266322052..03bbce6cb3 100644 --- a/core/templates/hash_set.h +++ b/core/templates/hash_set.h @@ -31,7 +31,7 @@ #pragma once #include "core/os/memory.h" -#include "core/string/print_string.h" +#include "core/string/print_string.h" // IWYU pragma: keep. `WARN_VERBOSE` macro. #include "core/templates/hashfuncs.h" /** diff --git a/core/templates/local_vector.h b/core/templates/local_vector.h index bf6fdc072a..13aea6fded 100644 --- a/core/templates/local_vector.h +++ b/core/templates/local_vector.h @@ -32,7 +32,7 @@ #include "core/error/error_macros.h" #include "core/os/memory.h" -#include "core/string/print_string.h" +#include "core/string/print_string.h" // IWYU pragma: keep. `WARN_VERBOSE` macro. #include "core/templates/sort_array.h" #include "core/templates/vector.h" diff --git a/core/variant/dictionary.cpp b/core/variant/dictionary.cpp index b9ab03249a..9ca4ba2a56 100644 --- a/core/variant/dictionary.cpp +++ b/core/variant/dictionary.cpp @@ -38,10 +38,6 @@ STATIC_ASSERT_INCOMPLETE_TYPE(class, String); #include "core/templates/safe_refcount.h" #include "core/variant/container_type_validate.h" #include "core/variant/variant.h" -// required in this order by VariantInternal, do not remove this comment. -#include "core/object/class_db.h" -#include "core/object/object.h" -#include "core/variant/type_info.h" #include "core/variant/variant_internal.h" struct DictionaryPrivate { diff --git a/core/variant/variant.h b/core/variant/variant.h index 4bc236d557..ed7d195ff9 100644 --- a/core/variant/variant.h +++ b/core/variant/variant.h @@ -30,7 +30,7 @@ #pragma once -#include "core/core_string_names.h" +#include "core/core_string_names.h" // IWYU pragma: export. Make available everywhere. #include "core/error/error_macros.h" #include "core/io/ip_address.h" #include "core/math/aabb.h" diff --git a/core/variant/variant_call.cpp b/core/variant/variant_call.cpp index 4c7994b86e..057c24e6de 100644 --- a/core/variant/variant_call.cpp +++ b/core/variant/variant_call.cpp @@ -30,14 +30,15 @@ #include "variant.h" -#include "core/crypto/crypto_core.h" #include "core/debugger/engine_debugger.h" #include "core/io/compression.h" #include "core/io/marshalls.h" -#include "core/object/class_db.h" #include "core/os/os.h" #include "core/templates/a_hash_map.h" #include "core/templates/local_vector.h" +#include "core/variant/binder_common.h" +#include "core/variant/method_ptrcall.h" +#include "core/variant/variant_internal.h" typedef void (*VariantFunc)(Variant &r_ret, Variant &p_self, const Variant **p_args); typedef void (*VariantConstructFunc)(Variant &r_ret, const Variant **p_args); diff --git a/core/variant/variant_construct.h b/core/variant/variant_construct.h index 48391488f3..2eefc8627d 100644 --- a/core/variant/variant_construct.h +++ b/core/variant/variant_construct.h @@ -32,13 +32,8 @@ #include "variant.h" -#include "core/crypto/crypto_core.h" -#include "core/debugger/engine_debugger.h" -#include "core/io/compression.h" #include "core/templates/a_hash_map.h" -#include "core/templates/local_vector.h" #include "core/variant/binder_common.h" -#include "core/variant/native_ptr.h" #include "core/variant/variant_internal.h" template diff --git a/core/variant/variant_op.h b/core/variant/variant_op.h index 3ddea025d6..de1190f574 100644 --- a/core/variant/variant_op.h +++ b/core/variant/variant_op.h @@ -32,8 +32,9 @@ #include "variant.h" -#include "core/debugger/engine_debugger.h" -#include "core/variant/native_ptr.h" +#include "core/variant/method_ptrcall.h" +#include "core/variant/type_info.h" +#include "core/variant/variant_internal.h" template class CommonEvaluate { diff --git a/core/variant/variant_setget.cpp b/core/variant/variant_setget.cpp index ec9a25cdae..91f92dda59 100644 --- a/core/variant/variant_setget.cpp +++ b/core/variant/variant_setget.cpp @@ -29,9 +29,10 @@ /**************************************************************************/ #include "variant_setget.h" -#include "variant_callable.h" +#include "core/debugger/engine_debugger.h" #include "core/io/resource.h" +#include "core/variant/variant_callable.h" struct VariantSetterGetterInfo { void (*setter)(Variant *base, const Variant *value, bool &valid); diff --git a/core/variant/variant_setget.h b/core/variant/variant_setget.h index c8176c2fff..1f56d8d591 100644 --- a/core/variant/variant_setget.h +++ b/core/variant/variant_setget.h @@ -32,8 +32,7 @@ #include "variant.h" -#include "core/debugger/engine_debugger.h" -#include "core/variant/native_ptr.h" +#include "core/variant/method_ptrcall.h" #include "core/variant/variant_internal.h" /**** NAMED SETTERS AND GETTERS ****/ diff --git a/core/variant/variant_utility.cpp b/core/variant/variant_utility.cpp index 29893fccab..5f048ed456 100644 --- a/core/variant/variant_utility.cpp +++ b/core/variant/variant_utility.cpp @@ -32,7 +32,6 @@ #include "core/io/marshalls.h" #include "core/object/ref_counted.h" -#include "core/object/script_language.h" #include "core/os/os.h" #include "core/templates/a_hash_map.h" #include "core/templates/rid.h" diff --git a/editor/animation/animation_track_editor.h b/editor/animation/animation_track_editor.h index 7425d6a3ef..ff8a7656e1 100644 --- a/editor/animation/animation_track_editor.h +++ b/editor/animation/animation_track_editor.h @@ -41,6 +41,8 @@ #include "scene/gui/tree.h" #include "scene/resources/animation.h" +#include // FLT_MAX + class AnimationMarkerEdit; class AnimationTrackEditor; class AnimationTrackEdit; diff --git a/editor/doc/doc_tools.cpp b/editor/doc/doc_tools.cpp index 63fe9bd57c..ae8688fb00 100644 --- a/editor/doc/doc_tools.cpp +++ b/editor/doc/doc_tools.cpp @@ -37,6 +37,7 @@ #include "core/io/compression.h" #include "core/io/dir_access.h" #include "core/io/resource_importer.h" +#include "core/io/xml_parser.h" #include "core/object/class_db.h" #include "core/object/script_language.h" #include "core/string/translation_server.h" diff --git a/editor/doc/doc_tools.h b/editor/doc/doc_tools.h index b66ce59c6b..f11133c65c 100644 --- a/editor/doc/doc_tools.h +++ b/editor/doc/doc_tools.h @@ -33,6 +33,8 @@ #include "core/doc_data.h" #include "core/templates/rb_set.h" +class XMLParser; + class DocTools { public: String version; diff --git a/main/main.cpp b/main/main.cpp index 98c75fadbf..3c99ae8504 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -57,6 +57,7 @@ #include "core/profiling/profiling.h" #include "core/register_core_types.h" #include "core/string/translation_server.h" +#include "core/variant/variant_parser.h" #include "core/version.h" #include "drivers/register_driver_types.h" #include "main/app_icon.gen.h" diff --git a/modules/csg/csg_shape.cpp b/modules/csg/csg_shape.cpp index 8119666f44..028279d53c 100644 --- a/modules/csg/csg_shape.cpp +++ b/modules/csg/csg_shape.cpp @@ -49,6 +49,8 @@ #include +#include // FLT_EPSILON + #ifndef NAVIGATION_3D_DISABLED Callable CSGShape3D::_navmesh_source_geometry_parsing_callback; RID CSGShape3D::_navmesh_source_geometry_parser; diff --git a/modules/gltf/editor/editor_import_blend_runner.cpp b/modules/gltf/editor/editor_import_blend_runner.cpp index b11800c4eb..cbfd099e0f 100644 --- a/modules/gltf/editor/editor_import_blend_runner.cpp +++ b/modules/gltf/editor/editor_import_blend_runner.cpp @@ -31,6 +31,7 @@ #include "editor_import_blend_runner.h" #include "core/io/http_client.h" +#include "core/io/xml_parser.h" #include "core/object/callable_mp.h" #include "core/os/os.h" #include "editor/editor_node.h" diff --git a/modules/gltf/extensions/gltf_light.cpp b/modules/gltf/extensions/gltf_light.cpp index 64aa7f2260..830b62293c 100644 --- a/modules/gltf/extensions/gltf_light.cpp +++ b/modules/gltf/extensions/gltf_light.cpp @@ -35,6 +35,8 @@ #include "core/object/class_db.h" #include "scene/3d/light_3d.h" +#include // FLT_MAX + void GLTFLight::_bind_methods() { ClassDB::bind_static_method("GLTFLight", D_METHOD("from_node", "light_node"), &GLTFLight::from_node); ClassDB::bind_method(D_METHOD("to_node"), &GLTFLight::to_node); diff --git a/modules/godot_physics_3d/godot_body_pair_3d.cpp b/modules/godot_physics_3d/godot_body_pair_3d.cpp index bc69ef1dcf..1bbd1289df 100644 --- a/modules/godot_physics_3d/godot_body_pair_3d.cpp +++ b/modules/godot_physics_3d/godot_body_pair_3d.cpp @@ -33,6 +33,8 @@ #include "godot_collision_solver_3d.h" #include "godot_space_3d.h" +#include // FLT_MAX + #define MIN_VELOCITY 0.0001 #define MAX_BIAS_ROTATION (Math::PI / 8) diff --git a/modules/navigation_2d/nav_utils_2d.h b/modules/navigation_2d/nav_utils_2d.h index 4c33c16669..c45ef2b0ae 100644 --- a/modules/navigation_2d/nav_utils_2d.h +++ b/modules/navigation_2d/nav_utils_2d.h @@ -37,6 +37,8 @@ #include "core/templates/local_vector.h" #include "servers/navigation_2d/navigation_constants_2d.h" +#include // FLT_MAX + class NavBaseIteration2D; namespace Nav2D { diff --git a/modules/navigation_3d/nav_utils_3d.h b/modules/navigation_3d/nav_utils_3d.h index d18fb92c58..5b8b4aff87 100644 --- a/modules/navigation_3d/nav_utils_3d.h +++ b/modules/navigation_3d/nav_utils_3d.h @@ -37,6 +37,8 @@ #include "core/templates/local_vector.h" #include "servers/navigation_3d/navigation_constants_3d.h" +#include // FLT_MAX + class NavBaseIteration3D; namespace Nav3D { diff --git a/modules/noise/noise.cpp b/modules/noise/noise.cpp index 55d936159e..5c5f51848d 100644 --- a/modules/noise/noise.cpp +++ b/modules/noise/noise.cpp @@ -32,6 +32,8 @@ #include "core/object/class_db.h" +#include // FLT_MAX + Vector> Noise::_get_seamless_image(int p_width, int p_height, int p_depth, bool p_invert, bool p_in_3d_space, real_t p_blend_skirt, bool p_normalize) const { ERR_FAIL_COND_V(p_width <= 0 || p_height <= 0 || p_depth <= 0, Vector>()); diff --git a/modules/xatlas_unwrap/register_types.cpp b/modules/xatlas_unwrap/register_types.cpp index e5da9b3a4f..60d6bb8931 100644 --- a/modules/xatlas_unwrap/register_types.cpp +++ b/modules/xatlas_unwrap/register_types.cpp @@ -31,9 +31,13 @@ #include "register_types.h" #include "core/crypto/crypto_core.h" +#include "core/error/error_macros.h" +#include "core/os/memory.h" #include +#include + extern bool (*array_mesh_lightmap_unwrap_callback)(float p_texel_size, const float *p_vertices, const float *p_normals, int p_vertex_count, const int *p_indices, int p_index_count, const uint8_t *p_cache_data, bool *r_use_cache, uint8_t **r_mesh_cache, int *r_mesh_cache_size, float **r_uv, int **r_vertex, int *r_vertex_count, int **r_index, int *r_index_count, int *r_size_hint_x, int *r_size_hint_y); bool xatlas_mesh_lightmap_unwrap_callback(float p_texel_size, const float *p_vertices, const float *p_normals, int p_vertex_count, const int *p_indices, int p_index_count, const uint8_t *p_cache_data, bool *r_use_cache, uint8_t **r_mesh_cache, int *r_mesh_cache_size, float **r_uv, int **r_vertex, int *r_vertex_count, int **r_index, int *r_index_count, int *r_size_hint_x, int *r_size_hint_y) { diff --git a/platform/linuxbsd/x11/display_server_x11.h b/platform/linuxbsd/x11/display_server_x11.h index 289c62a129..38b4a7a720 100644 --- a/platform/linuxbsd/x11/display_server_x11.h +++ b/platform/linuxbsd/x11/display_server_x11.h @@ -36,6 +36,7 @@ #include "core/os/mutex.h" #include "core/os/process_id.h" #include "core/os/thread.h" +#include "core/os/thread_safe.h" #include "core/templates/local_vector.h" #include "servers/display/display_server.h" diff --git a/platform/macos/display_server_macos_base.h b/platform/macos/display_server_macos_base.h index 2d53766129..de9ae92290 100644 --- a/platform/macos/display_server_macos_base.h +++ b/platform/macos/display_server_macos_base.h @@ -30,6 +30,7 @@ #pragma once +#include "core/os/thread_safe.h" #include "servers/display/display_server.h" #define FontVariation __FontVariation diff --git a/scene/3d/mesh_instance_3d.cpp b/scene/3d/mesh_instance_3d.cpp index e3141d6c88..6648a9ec4b 100644 --- a/scene/3d/mesh_instance_3d.cpp +++ b/scene/3d/mesh_instance_3d.cpp @@ -47,7 +47,11 @@ #include "scene/resources/navigation_mesh.h" #include "servers/navigation_3d/navigation_server_3d.h" #include "servers/rendering/rendering_server.h" +#endif // NAVIGATION_3D_DISABLED +#include // FLT_EPSILON + +#ifndef NAVIGATION_3D_DISABLED Callable MeshInstance3D::_navmesh_source_geometry_parsing_callback; RID MeshInstance3D::_navmesh_source_geometry_parser; #endif // NAVIGATION_3D_DISABLED diff --git a/scene/gui/graph_edit_arranger.cpp b/scene/gui/graph_edit_arranger.cpp index 1c21ba978a..7cd0ff7ddf 100644 --- a/scene/gui/graph_edit_arranger.cpp +++ b/scene/gui/graph_edit_arranger.cpp @@ -32,6 +32,8 @@ #include "scene/gui/graph_edit.h" +#include // FLT_MIN, FLT_MAX + void GraphEditArranger::arrange_nodes() { ERR_FAIL_NULL(graph_edit); diff --git a/scene/gui/tab_bar.cpp b/scene/gui/tab_bar.cpp index e668452151..258bfb1f0d 100644 --- a/scene/gui/tab_bar.cpp +++ b/scene/gui/tab_bar.cpp @@ -41,6 +41,8 @@ #include "scene/theme/theme_db.h" #include "servers/display/accessibility_server.h" +#include // FLT_MAX + static inline Color _select_color(const Color &p_override_color, const Color &p_default_color) { return p_override_color.a > 0 ? p_override_color : p_default_color; } diff --git a/scene/main/node.h b/scene/main/node.h index 80d7f594dd..111ead3fa6 100644 --- a/scene/main/node.h +++ b/scene/main/node.h @@ -34,6 +34,7 @@ #include "core/object/gdvirtual.gen.h" #include "core/object/object.h" #include "core/object/ref_counted.h" +#include "core/os/thread_safe.h" #include "core/templates/iterable.h" #include "scene/scene_string_names.h" // IWYU pragma: export. Make available to all Nodes. diff --git a/scene/resources/3d/height_map_shape_3d.cpp b/scene/resources/3d/height_map_shape_3d.cpp index 494cea051c..e7a82bd31b 100644 --- a/scene/resources/3d/height_map_shape_3d.cpp +++ b/scene/resources/3d/height_map_shape_3d.cpp @@ -35,6 +35,8 @@ #include "scene/resources/mesh.h" #include "servers/physics_3d/physics_server_3d.h" +#include // FLT_MAX + Vector HeightMapShape3D::get_debug_mesh_lines() const { Vector points; diff --git a/scene/resources/3d/importer_mesh.cpp b/scene/resources/3d/importer_mesh.cpp index 04a798db11..df98b50772 100644 --- a/scene/resources/3d/importer_mesh.cpp +++ b/scene/resources/3d/importer_mesh.cpp @@ -39,6 +39,8 @@ #include "core/math/convex_hull.h" #endif // PHYSICS_3D_DISABLED +#include // FLT_EPSILON + Ref ImporterMesh::merge_importer_meshes(const TypedArray &p_importer_meshes, const TypedArray &p_relative_transforms, bool p_deduplicate_surfaces) { // Setup and safety checks. const int mesh_count = p_importer_meshes.size(); diff --git a/scene/resources/curve.cpp b/scene/resources/curve.cpp index c21b0945b8..8bb8b2b868 100644 --- a/scene/resources/curve.cpp +++ b/scene/resources/curve.cpp @@ -33,6 +33,8 @@ #include "core/math/math_funcs.h" #include "core/object/class_db.h" +#include // FLT_EPSILON + const char *Curve::SIGNAL_RANGE_CHANGED = "range_changed"; const char *Curve::SIGNAL_DOMAIN_CHANGED = "domain_changed"; diff --git a/scene/resources/style_box_flat.cpp b/scene/resources/style_box_flat.cpp index fc4373f562..24d784d922 100644 --- a/scene/resources/style_box_flat.cpp +++ b/scene/resources/style_box_flat.cpp @@ -35,6 +35,8 @@ #include "servers/rendering/rendering_server.h" #include "servers/text/text_server.h" +#include // FLT_EPSILON + float StyleBoxFlat::get_style_margin(Side p_side) const { ERR_FAIL_INDEX_V((int)p_side, 4, 0.0); return border_width[p_side]; diff --git a/scene/resources/text_paragraph.h b/scene/resources/text_paragraph.h index 5a5a2c6d2e..21561dcb78 100644 --- a/scene/resources/text_paragraph.h +++ b/scene/resources/text_paragraph.h @@ -30,6 +30,7 @@ #pragma once +#include "core/os/thread_safe.h" #include "core/templates/local_vector.h" #include "scene/resources/font.h" #include "servers/text/text_server.h" diff --git a/servers/rendering/renderer_scene_occlusion_cull.h b/servers/rendering/renderer_scene_occlusion_cull.h index 21585048b0..675a80f486 100644 --- a/servers/rendering/renderer_scene_occlusion_cull.h +++ b/servers/rendering/renderer_scene_occlusion_cull.h @@ -35,6 +35,8 @@ #include "core/templates/local_vector.h" #include "servers/rendering/rendering_server_enums.h" +#include // FLT_MIN, FLT_MAX + class RendererSceneOcclusionCull { protected: static RendererSceneOcclusionCull *singleton; diff --git a/tests/core/io/test_json.cpp b/tests/core/io/test_json.cpp index 6f753c1a21..7eb28d98f4 100644 --- a/tests/core/io/test_json.cpp +++ b/tests/core/io/test_json.cpp @@ -35,6 +35,8 @@ TEST_FORCE_LINK(test_json) #include "core/io/json.h" #include "core/variant/typed_array.h" +#include // DBL_MAX + namespace TestJSON { TEST_CASE("[JSON] Stringify single data types") {