Skip to content

Commit

Permalink
fixed gnustl issue (#2)
Browse files Browse the repository at this point in the history
AngelDev06 authored Aug 1, 2024
1 parent 1087306 commit b115714
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions broma_ida/types/stl_types.hpp
Original file line number Diff line number Diff line change
@@ -13,6 +13,29 @@
#include <set>
#include <unordered_set>

#if defined(BROMAIDA_PLATFORM_ANDROID32) || defined(BROMAIDA_PLATFORM_ANDROID64)

// idaclang thinks empty classes occupy 0 bytes of space therefore breaking the
// implementation of std::map/std::set (caused by the empty class std::less)
template <typename T>
struct custom_less : std::less<T>
{
bool pad;
};

namespace std
{
// providing custom specializations for standard library templates is
// technically UB but clang allows it
template <typename Key, typename T, typename Alloc>
class map<Key, T, less<Key>, Alloc> : public map<Key, T, custom_less<Key>, Alloc> {};

template <typename Key, typename Alloc>
class set<Key, less<Key>, Alloc> : public set<Key, custom_less<Key>, Alloc> {};
}

#endif

#endif

#include "enums.hpp"

0 comments on commit b115714

Please sign in to comment.