chore: drop a few more dead winapi_stubs.h includes

This commit is contained in:
MatthewBeshay 2026-04-08 21:39:05 +10:00
parent 50fdbeea80
commit 9bbcf7dda9
6 changed files with 12 additions and 5 deletions

View file

@ -67,8 +67,20 @@ USAGE_PATTERNS = [
]
def strip_comments(text: str) -> str:
"""Strip C++ // and /* */ comments. Approximate but good enough for
detecting whether a symbol appears in real code vs commented-out
code."""
# Strip /* ... */ comments (multiline)
text = re.sub(r'/\*.*?\*/', '', text, flags=re.DOTALL)
# Strip // ... comments (single line)
text = re.sub(r'//[^\n]*', '', text)
return text
def needs_winapi(text: str) -> bool:
scan = INCLUDE_RE.sub("", text)
scan = strip_comments(scan)
return any(p.search(scan) for p in USAGE_PATTERNS)

View file

@ -25,7 +25,6 @@
#include "app/common/UI/All Platforms/UIEnums.h"
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/linux/Linux_UIController.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "java/Class.h"
#include "java/Random.h"
#include "minecraft/GameEnums.h"

View file

@ -33,7 +33,6 @@
#include "app/common/UI/All Platforms/UIStructs.h"
#include "app/common/UI/Scenes/In-Game Menu Screens/Containers/UIScene_TradingMenu.h"
#include "app/linux/Linux_UIController.h"
#include "app/linux/Stubs/winapi_stubs.h"
#include "MultiPlayerLevel.h"
#include "ReceivingLevelScreen.h"
#include "util/Timer.h"

View file

@ -13,7 +13,6 @@
#include <unordered_set>
#include <vector>
#include "app/linux/Stubs/winapi_stubs.h"
#include "java/Exceptions.h"
#include "java/InputOutputStream/DataInputStream.h"
#include "java/InputOutputStream/DataOutputStream.h"

View file

@ -8,7 +8,6 @@
#include <vector>
#include "app/linux/Stubs/winapi_stubs.h"
#include "platform/NetTypes.h"
#include "util/Definitions.h"
#include "java/InputOutputStream/DataInputStream.h"

View file

@ -7,7 +7,6 @@
#include <cstdint>
#include <string>
#include "app/linux/Stubs/winapi_stubs.h"
#include "minecraft/world/level/storage/ConsoleSaveFileIO/compression.h"
#include "java/File.h"
#include "java/InputOutputStream/ByteArrayInputStream.h"