mirror of
https://github.com/open-goal/jak-project
synced 2026-06-20 00:08:14 -04:00
Aren't functions hoisted..?
This commit is contained in:
+14
-14
@@ -313,20 +313,6 @@ u64 make_string_from_c(const char* c_str) {
|
||||
return mem;
|
||||
}
|
||||
|
||||
/*!
|
||||
* Create a GOAL function from a C function. This doesn't export it as a global function, it just
|
||||
* creates a function object on the global heap.
|
||||
*
|
||||
* The implementation is to create a simple trampoline function which jumps to the C function.
|
||||
*/
|
||||
Ptr<Function> make_function_from_c(void* func) {
|
||||
#ifdef __linux__
|
||||
return make_function_from_c_linux(func);
|
||||
#elif _WIN32
|
||||
return make_function_from_c_win32(func);
|
||||
#endif
|
||||
}
|
||||
|
||||
Ptr<Function> make_function_from_c_linux(void* func) {
|
||||
// allocate a function object on the global heap
|
||||
auto mem = Ptr<u8>(
|
||||
@@ -400,6 +386,20 @@ Ptr<Function> make_function_from_c_win32(void* func) {
|
||||
return mem.cast<Function>();
|
||||
}
|
||||
|
||||
/*!
|
||||
* Create a GOAL function from a C function. This doesn't export it as a global function, it just
|
||||
* creates a function object on the global heap.
|
||||
*
|
||||
* The implementation is to create a simple trampoline function which jumps to the C function.
|
||||
*/
|
||||
Ptr<Function> make_function_from_c(void* func) {
|
||||
#ifdef __linux__
|
||||
return make_function_from_c_linux(func);
|
||||
#elif _WIN32
|
||||
return make_function_from_c_win32(func);
|
||||
#endif
|
||||
}
|
||||
|
||||
/*!
|
||||
* Create a GOAL function which does nothing and immediately returns.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user