mirror of
https://github.com/4jcraft/4jcraft.git
synced 2026-04-30 05:53:36 +00:00
chore: drop a few more dead winapi_stubs.h includes
This commit is contained in:
parent
50fdbeea80
commit
9bbcf7dda9
|
|
@ -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)
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
Loading…
Reference in a new issue