diff --git a/core/input/input_builders.py b/core/input/input_builders.py index e98e2441e25..94c566493e9 100644 --- a/core/input/input_builders.py +++ b/core/input/input_builders.py @@ -45,10 +45,10 @@ def make_default_controller_mappings(target, source, env): platform_mappings[current_platform][guid] = line platform_variables = { - "Linux": "#if LINUXBSD_ENABLED", + "Linux": "#ifdef LINUXBSD_ENABLED", "Windows": "#ifdef WINDOWS_ENABLED", "Mac OS X": "#ifdef MACOS_ENABLED", - "Android": "#if defined(__ANDROID__)", + "Android": "#ifdef ANDROID_ENABLED", "iOS": "#ifdef IOS_ENABLED", "Web": "#ifdef WEB_ENABLED", } diff --git a/main/main.cpp b/main/main.cpp index b50def9cec4..50ec7d82b4d 100644 --- a/main/main.cpp +++ b/main/main.cpp @@ -475,7 +475,7 @@ void Main::print_help(const char *p_binary) { OS::get_singleton()->print(" --profiling Enable profiling in the script debugger.\n"); OS::get_singleton()->print(" --gpu-profile Show a GPU profile of the tasks that took the most time during frame rendering.\n"); OS::get_singleton()->print(" --gpu-validation Enable graphics API validation layers for debugging.\n"); -#if DEBUG_ENABLED +#ifdef DEBUG_ENABLED OS::get_singleton()->print(" --gpu-abort Abort on graphics API usage errors (usually validation layer errors). May help see the problem if your system freezes.\n"); #endif OS::get_singleton()->print(" --generate-spirv-debug-info Generate SPIR-V debug information. This allows source-level shader debugging with RenderDoc.\n"); diff --git a/modules/gdscript/gdscript_byte_codegen.h b/modules/gdscript/gdscript_byte_codegen.h index 9bface6136a..f902cb10cc4 100644 --- a/modules/gdscript/gdscript_byte_codegen.h +++ b/modules/gdscript/gdscript_byte_codegen.h @@ -121,7 +121,7 @@ class GDScriptByteCodeGenerator : public GDScriptCodeGenerator { RBMap method_bind_map; RBMap lambdas_map; -#if DEBUG_ENABLED +#ifdef DEBUG_ENABLED // Keep method and property names for pointer and validated operations. // Used when disassembling the bytecode. Vector operator_names; diff --git a/modules/mono/csharp_script.cpp b/modules/mono/csharp_script.cpp index f7f674763eb..ef24dc35cac 100644 --- a/modules/mono/csharp_script.cpp +++ b/modules/mono/csharp_script.cpp @@ -1091,7 +1091,7 @@ void CSharpLanguage::reload_assemblies(bool p_soft_reload) { } // The script instance could not be instantiated or wasn't in the list of placeholders to replace. obj->set_script(scr); -#if DEBUG_ENABLED +#ifdef DEBUG_ENABLED // If we reached here, the instantiated script must be a placeholder. CRASH_COND(!obj->get_script_instance()->is_placeholder()); #endif @@ -2327,7 +2327,7 @@ void CSharpScript::reload_registered_script(Ref p_script) { p_script->_update_exports(); -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); @@ -2683,7 +2683,7 @@ Error CSharpScript::reload(bool p_keep_state) { _update_exports(); -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); diff --git a/modules/mono/glue/runtime_interop.cpp b/modules/mono/glue/runtime_interop.cpp index 3518507f8c7..0089e9c2a27 100644 --- a/modules/mono/glue/runtime_interop.cpp +++ b/modules/mono/glue/runtime_interop.cpp @@ -316,7 +316,7 @@ void godotsharp_internal_new_csharp_script(Ref *r_dest) { } void godotsharp_internal_editor_file_system_update_file(const String *p_script_path) { -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // If the EditorFileSystem singleton is available, update the file; // otherwise, the file will be updated when the singleton becomes available. EditorFileSystem *efs = EditorFileSystem::get_singleton(); diff --git a/modules/mono/utils/path_utils.cpp b/modules/mono/utils/path_utils.cpp index aa975346756..ee17a668d75 100644 --- a/modules/mono/utils/path_utils.cpp +++ b/modules/mono/utils/path_utils.cpp @@ -152,7 +152,7 @@ String realpath(const String &p_path) { } return result.simplify_path(); -#elif UNIX_ENABLED +#elif defined(UNIX_ENABLED) char *resolved_path = ::realpath(p_path.utf8().get_data(), nullptr); if (!resolved_path) { diff --git a/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp b/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp index 1289183ea48..c3f692185b5 100644 --- a/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp +++ b/modules/openxr/extensions/openxr_fb_update_swapchain_extension.cpp @@ -30,7 +30,7 @@ #include "openxr_fb_update_swapchain_extension.h" -// always include this as late as possible +// Always include this as late as possible. #include "../openxr_platform_inc.h" OpenXRFBUpdateSwapchainExtension *OpenXRFBUpdateSwapchainExtension::singleton = nullptr; diff --git a/modules/openxr/extensions/openxr_opengl_extension.h b/modules/openxr/extensions/openxr_opengl_extension.h index 3b0aa0bce92..5f529829a70 100644 --- a/modules/openxr/extensions/openxr_opengl_extension.h +++ b/modules/openxr/extensions/openxr_opengl_extension.h @@ -39,7 +39,7 @@ #include "core/templates/vector.h" -// always include this as late as possible +// Always include this as late as possible. #include "../openxr_platform_inc.h" class OpenXROpenGLExtension : public OpenXRGraphicsExtensionWrapper { @@ -65,9 +65,9 @@ private: #ifdef WIN32 static XrGraphicsBindingOpenGLWin32KHR graphics_binding_gl; -#elif ANDROID_ENABLED +#elif defined(ANDROID_ENABLED) static XrGraphicsBindingOpenGLESAndroidKHR graphics_binding_gl; -#else +#else // Linux/X11 static XrGraphicsBindingOpenGLXlibKHR graphics_binding_gl; #endif diff --git a/modules/openxr/extensions/openxr_vulkan_extension.h b/modules/openxr/extensions/openxr_vulkan_extension.h index f31621fda0f..86c0f327dd6 100644 --- a/modules/openxr/extensions/openxr_vulkan_extension.h +++ b/modules/openxr/extensions/openxr_vulkan_extension.h @@ -37,7 +37,7 @@ #include "core/templates/vector.h" -// always include this as late as possible +// Always include this as late as possible. #include "../openxr_platform_inc.h" class OpenXRVulkanExtension : public OpenXRGraphicsExtensionWrapper, VulkanHooks { diff --git a/tests/scene/test_audio_stream_wav.h b/tests/scene/test_audio_stream_wav.h index e36f0491369..ed1697929e2 100644 --- a/tests/scene/test_audio_stream_wav.h +++ b/tests/scene/test_audio_stream_wav.h @@ -148,7 +148,7 @@ void run_test(String file_name, AudioStreamWAV::Format data_format, bool stereo, Ref wav_file = FileAccess::open(save_path, FileAccess::READ, &error); REQUIRE(error == OK); -#if TOOLS_ENABLED +#ifdef TOOLS_ENABLED // The WAV importer can be used if enabled to check that the saved file is valid. Ref wav_importer = memnew(ResourceImporterWAV);