Skip to content
Snippets Groups Projects
Commit 791a386f authored by Marek Vavruša's avatar Marek Vavruša
Browse files

tests/unit: portability fixes for gomodule on ELF

parent ac1b7164
No related branches found
No related tags found
No related merge requests found
......@@ -164,4 +164,6 @@ void kr_module_unload(struct kr_module *module)
if (module->lib && module->lib != RTLD_DEFAULT) {
dlclose(module->lib);
}
memset(module, 0, sizeof(struct kr_module));
}
......@@ -16,7 +16,6 @@ static inline const knot_layer_api_t *_gostats_layer(void)
*/
import "C"
import "unsafe"
import "fmt"
func Api() C.uint32_t {
return C.KR_MODULE_API
......
......@@ -29,7 +29,14 @@ void __go_init_main() {}
*/
/* \note Renamed to mimick Go module. */
extern uint32_t Api(void) __asm__ ("_main.Api");
#if defined(__APPLE__)
extern uint32_t Api(void) __asm__ ("_main.Api"); /* Mach-O */
#elif _WIN32
#error DLL format is not supported for Golang modules.
#else
extern uint32_t Api(void) __asm__ ("main.Api"); /* ELF */
#endif
uint32_t Api(void)
{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment