From fa40b68a371f8642ce65411f8093b5fc41fd5e14 Mon Sep 17 00:00:00 2001 From: Tyler Wilding Date: Fri, 4 Sep 2020 19:43:45 -0400 Subject: [PATCH] Aren't functions hoisted..? --- game/kernel/kscheme.cpp | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/game/kernel/kscheme.cpp b/game/kernel/kscheme.cpp index d6f9f7a16e..5d32b9e649 100644 --- a/game/kernel/kscheme.cpp +++ b/game/kernel/kscheme.cpp @@ -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 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 make_function_from_c_linux(void* func) { // allocate a function object on the global heap auto mem = Ptr( @@ -400,6 +386,20 @@ Ptr make_function_from_c_win32(void* func) { return mem.cast(); } +/*! + * 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 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. */