From 062f2e3613c1e656f7d4b3fbc989a8304a852b0c Mon Sep 17 00:00:00 2001 From: Deve Date: Sat, 4 Nov 2023 23:00:54 +0100 Subject: [PATCH] Remove unused function that fails to build with new C++ --- Android/native/jni/Application.mk | 2 +- .../MultiCraft.xcodeproj/project.pbxproj | 2 -- src/irrlicht_changes/irrUString.h | 33 ------------------- 3 files changed, 1 insertion(+), 36 deletions(-) diff --git a/Android/native/jni/Application.mk b/Android/native/jni/Application.mk index 802476625..73e92af84 100644 --- a/Android/native/jni/Application.mk +++ b/Android/native/jni/Application.mk @@ -10,7 +10,7 @@ else APP_CFLAGS := -g -D_DEBUG -O1 -fno-omit-frame-pointer endif -APP_CFLAGS += -fexceptions -D_LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION +APP_CFLAGS += -fexceptions APP_CXXFLAGS := $(APP_CFLAGS) -frtti -std=gnu++17 #-Werror=shorten-64-to-32 diff --git a/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj b/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj index 19327c809..637c910b1 100644 --- a/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj +++ b/Apple/MultiCraft/MultiCraft.xcodeproj/project.pbxproj @@ -2185,7 +2185,6 @@ ENABLE_HARDENED_RUNTIME = YES; GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", - _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION, "RUN_IN_PLACE=0", "USE_GETTEXT=1", "USE_CURL=1", @@ -2259,7 +2258,6 @@ GCC_PREPROCESSOR_DEFINITIONS = ( "$(inherited)", "NDEBUG=1", - _LIBCPP_ENABLE_CXX17_REMOVED_UNARY_BINARY_FUNCTION, "RUN_IN_PLACE=0", "USE_GETTEXT=1", "USE_CURL=1", diff --git a/src/irrlicht_changes/irrUString.h b/src/irrlicht_changes/irrUString.h index ce9f2bc7e..d2346181f 100644 --- a/src/irrlicht_changes/irrUString.h +++ b/src/irrlicht_changes/irrUString.h @@ -3857,38 +3857,5 @@ inline std::wostream& operator<<(std::wostream& out, const ustring16& in } #endif - -#ifndef USTRING_NO_STL - -namespace unicode -{ - -//! Hashing algorithm for hashing a ustring. Used for things like unordered_maps. -//! Algorithm taken from std::hash. -class hash : public std::unary_function -{ - public: - size_t operator()(const core::ustring& s) const - { - size_t ret = 2166136261U; - size_t index = 0; - size_t stride = 1 + s.size_raw() / 10; - - core::ustring::const_iterator i = s.begin(); - while (i != s.end()) - { - // TODO: Don't force u32 on an x64 OS. Make it agnostic. - ret = 16777619U * ret ^ (size_t)s[(u32)index]; - index += stride; - i += stride; - } - return (ret); - } -}; - -} // end namespace unicode - -#endif - } // end namespace core } // end namespace irr