diff --git a/codegen/src/AddressGen.cpp b/codegen/src/AddressGen.cpp index bc154b1c..295ccbde 100644 --- a/codegen/src/AddressGen.cpp +++ b/codegen/src/AddressGen.cpp @@ -122,7 +122,7 @@ std::string generateAddressHeader(Root const& root) { } else if (codegen::getStatus(field) == BindStatus::Binded && fn->prototype.type == FunctionType::Normal) { address_str = fmt::format( - "addresser::get{}Virtual(Resolve<{}>::func(&{}::{}))", + "0/*addresser::get{}Virtual(Resolve<{}>::func(&{}::{}))*/", str_if("Non", !fn->prototype.is_virtual), codegen::getParameterTypes(fn->prototype), field.parent, diff --git a/loader/src/platform/android/gdstdlib.cpp b/loader/src/platform/android/gdstdlib.cpp new file mode 100644 index 00000000..d4ec8653 --- /dev/null +++ b/loader/src/platform/android/gdstdlib.cpp @@ -0,0 +1,61 @@ +#include + +#ifdef GEODE_IS_ANDROID + +namespace gd { + namespace { + static inline auto emptyInternalString() { + return reinterpret_cast<_internal_string*>( + *reinterpret_cast(geode::base::get() + 0x75fb24) + sizeof(_internal_string) + ); + } + } + + string::string() : m_data(nullptr) { + m_data = emptyInternalString(); + } + + string::string(char const* ok) : m_data(nullptr) { + reinterpret_cast(geode::base::get() + 0x506c08)(this, ok); + } + + string::string(string const& ok) : m_data(nullptr) { + if (*(string**)(&ok) == nullptr) return; + reinterpret_cast(geode::base::get() + 0x506634)(this, ok); + } + + string& string::operator=(char const* ok) { + this->~string(); + new (this) string(ok); + return *this; + } + + string& string::operator=(string const& ok) { + this->~string(); + new (this) string(ok); + return *this; + } + + string::~string() { + if (m_data == nullptr) return; + reinterpret_cast(geode::base::get() + 0x5054bc)( + &m_data[-1] + ); + } + + bool string::operator<(string const& other) const { + return std::string(*this) < std::string(other); + } + + bool string::operator==(string const& other) const { + return std::string(*this) == std::string(other); + } + + // TODO: these need to stay for old mods linking against geode <1.2.0, remove in 2.0.0 + template class map; + template class map; + template class map; + template class map; +} + +#endif \ No newline at end of file