From a0a734cb2ebd44d3a34b09cebc9331660d13bdcd Mon Sep 17 00:00:00 2001 From: Tobiasz Laskowski Date: Wed, 16 Sep 2026 12:07:37 +0100 Subject: [PATCH] Remove hx/Unordered.h This was originally added because unordered_map/set were only available in c++11, so this would fall back to the ordered variants if they were unavailable. However, it would only use the unordered variants on msvc or if the preprocessor define HXCPP_CPP11 is set, which has only ever been the case on the android gcc toolchain: 86ca6eb00357f6939eb99378ff7f32dc60f15c29 Now C++11 has been a requirement for building the hxcpp runtime for a while, so we can just assume they are available instead of having these wrappers. --- include/hx/Unordered.h | 38 ------------------------------------ src/String.cpp | 1 - src/hx/Debug.cpp | 4 ++-- src/hx/cppia/Cppia.cpp | 1 - src/hx/cppia/Cppia.h | 6 +++--- src/hx/cppia/CppiaModule.cpp | 2 +- src/hx/cppia/HaxeNative.cpp | 4 ++-- src/hx/gc/Immix.cpp | 17 ++++++++-------- toolchain/haxe-target.xml | 1 - 9 files changed, 17 insertions(+), 57 deletions(-) delete mode 100644 include/hx/Unordered.h diff --git a/include/hx/Unordered.h b/include/hx/Unordered.h deleted file mode 100644 index ca5d69c77..000000000 --- a/include/hx/Unordered.h +++ /dev/null @@ -1,38 +0,0 @@ -#ifndef HX_UNORDERED_INCLUDED -#define HX_UNORDERED_INCLUDED - -#if (defined(_MSC_VER) && (_MSC_VER >= 1800)) || ( defined(__GNUC__) && defined(HXCPP_CPP11) ) -#include -#include - -namespace hx -{ - -template -struct UnorderedSet : public std::unordered_set { }; - -template -struct UnorderedMap : public std::unordered_map { }; - -} - - -#else - -#include -#include - -namespace hx -{ - -template -struct UnorderedSet : public std::set { }; - -template -struct UnorderedMap : public std::map { }; - -} - -#endif - -#endif diff --git a/src/String.cpp b/src/String.cpp index 1583ea238..d77fcf840 100644 --- a/src/String.cpp +++ b/src/String.cpp @@ -4,7 +4,6 @@ #include #include #include -#include #include "hx/Hash.h" #include #include diff --git a/src/hx/Debug.cpp b/src/hx/Debug.cpp index 2ad1f9667..c49cc935a 100644 --- a/src/hx/Debug.cpp +++ b/src/hx/Debug.cpp @@ -6,9 +6,9 @@ #include #include #include -#include #include #include +#include #include @@ -48,7 +48,7 @@ const char* EXTERN_CLASS_NAME = "extern"; #ifdef HXCPP_STACK_IDS static std::mutex sStackMapMutex; -typedef UnorderedMap StackMap; +typedef std::unordered_map StackMap; static StackMap sStackMap; #endif diff --git a/src/hx/cppia/Cppia.cpp b/src/hx/cppia/Cppia.cpp index 43618eb5b..ba68a29fa 100644 --- a/src/hx/cppia/Cppia.cpp +++ b/src/hx/cppia/Cppia.cpp @@ -1,7 +1,6 @@ #include #include #include -#include #include #include #include diff --git a/src/hx/cppia/Cppia.h b/src/hx/cppia/Cppia.h index 28252bd15..42085ed56 100644 --- a/src/hx/cppia/Cppia.h +++ b/src/hx/cppia/Cppia.h @@ -3,7 +3,7 @@ #include #include -#include +#include #include #include #include @@ -372,7 +372,7 @@ class CppiaModule std::vector< TypeData * > types; std::vector< CppiaClassInfo * > classes; std::vector< CppiaExpr * > markable; - hx::UnorderedSet allFileIds; + std::unordered_set allFileIds; typedef std::map< std::string, int > InterfaceSlots; InterfaceSlots interfaceSlots; @@ -601,7 +601,7 @@ class HaxeNativeClass static void link(); #ifndef NATIVE_CLASS_OVERRIDES_MARKED private: - void addVtableEntries( std::vector &outVtable, hx::UnorderedSet &outMethodsSet); + void addVtableEntries( std::vector &outVtable, std::unordered_set &outMethodsSet); #endif }; diff --git a/src/hx/cppia/CppiaModule.cpp b/src/hx/cppia/CppiaModule.cpp index 303e0443f..2d029c52b 100644 --- a/src/hx/cppia/CppiaModule.cpp +++ b/src/hx/cppia/CppiaModule.cpp @@ -108,7 +108,7 @@ void CppiaModule::registerDebugger() addScriptableClass( scriptable.makePermanent().utf8_str() ); } - for(hx::UnorderedSet::const_iterator i = allFileIds.begin(); i!=allFileIds.end(); ++i) + for(std::unordered_set::const_iterator i = allFileIds.begin(); i!=allFileIds.end(); ++i) addScriptableFile(strings[*i]); #if (HXCPP_API_LEVEL >= 500) diff --git a/src/hx/cppia/HaxeNative.cpp b/src/hx/cppia/HaxeNative.cpp index 6575493d4..38b715434 100644 --- a/src/hx/cppia/HaxeNative.cpp +++ b/src/hx/cppia/HaxeNative.cpp @@ -43,11 +43,11 @@ void HaxeNativeClass::addVtableEntries( std::vector &outVtable) } #else void HaxeNativeClass::addVtableEntries(std::vector& outVtable) { - hx::UnorderedSet methodsSet; + std::unordered_set methodsSet; addVtableEntries(outVtable, methodsSet); } -void HaxeNativeClass::addVtableEntries( std::vector &outVtable, hx::UnorderedSet& outMethodsSet) +void HaxeNativeClass::addVtableEntries( std::vector &outVtable, std::unordered_set& outMethodsSet) { if (haxeSuper) haxeSuper->addVtableEntries(outVtable, outMethodsSet); diff --git a/src/hx/gc/Immix.cpp b/src/hx/gc/Immix.cpp index fab5d8812..f3c7fa67d 100644 --- a/src/hx/gc/Immix.cpp +++ b/src/hx/gc/Immix.cpp @@ -6,7 +6,8 @@ #include #include "../Hash.h" #include "GcRegCapture.h" -#include +#include +#include #include #include #include @@ -47,7 +48,7 @@ namespace hx #ifdef HXCPP_GC_DEBUG_ALWAYS_MOVE enum { gAlwaysMove = true }; -typedef hx::UnorderedSet PointerMovedSet; +typedef std::unordered_set PointerMovedSet; PointerMovedSet sgPointerMoved; #else @@ -2374,10 +2375,10 @@ void MarkStringArray(String *inPtr, int inLength, hx::MarkContext *__inCtx) // --- Roots ------------------------------- FILE_SCOPE std::mutex* sGCRootLock = nullptr; -typedef hx::UnorderedSet RootSet; +typedef std::unordered_set RootSet; static RootSet sgRootSet; -typedef hx::UnorderedMap OffsetRootSet; +typedef std::unordered_map OffsetRootSet; static OffsetRootSet *sgOffsetRootSet=0; void GCAddRoot(hx::Object **inRoot) @@ -2456,20 +2457,20 @@ typedef hx::QuickVec FinalizerList; FILE_SCOPE FinalizerList *sgFinalizers = 0; -typedef hx::UnorderedMap FinalizerMap; +typedef std::unordered_map FinalizerMap; FILE_SCOPE FinalizerMap sFinalizerMap; typedef void (*HaxeFinalizer)(Dynamic); -typedef hx::UnorderedMap HaxeFinalizerMap; +typedef std::unordered_map HaxeFinalizerMap; FILE_SCOPE HaxeFinalizerMap sHaxeFinalizerMap; hx::QuickVec sFreeObjectIds; -typedef hx::UnorderedMap ObjectIdMap; +typedef std::unordered_map ObjectIdMap; typedef hx::QuickVec IdObjectMap; FILE_SCOPE ObjectIdMap sObjectIdMap; FILE_SCOPE IdObjectMap sIdObjectMap; -typedef hx::UnorderedSet MakeZombieSet; +typedef std::unordered_set MakeZombieSet; FILE_SCOPE MakeZombieSet sMakeZombieSet; typedef hx::QuickVec ZombieList; diff --git a/toolchain/haxe-target.xml b/toolchain/haxe-target.xml index 86da1a8ce..5d2a26ef2 100644 --- a/toolchain/haxe-target.xml +++ b/toolchain/haxe-target.xml @@ -54,7 +54,6 @@ -