mirror of
https://github.com/geode-sdk/geode.git
synced 2024-11-27 09:55:34 -05:00
18 lines
417 B
C++
18 lines
417 B
C++
#pragma once
|
|
|
|
#include <dlfcn.h>
|
|
|
|
namespace geode::base {
|
|
GEODE_NOINLINE inline uintptr_t get() {
|
|
static uintptr_t base = reinterpret_cast<uintptr_t>(dlopen("libcocos2dcpp.so", RTLD_LAZY));
|
|
return base;
|
|
}
|
|
}
|
|
|
|
namespace geode::cast {
|
|
template <class After, class Before>
|
|
After typeinfo_cast(Before ptr) {
|
|
// yall have symbols smh
|
|
return dynamic_cast<After>(ptr);
|
|
}
|
|
}
|