Fix function signature in #native
This commit is contained in:
parent
f4791c5177
commit
2edad022b6
@ -540,9 +540,9 @@ void execute(Stack *stack, Stack *originstack, char *modname)
|
||||
if (!module)
|
||||
kms(stack, "UNABLE TO OPEN DYNAMIC LIBRARY");
|
||||
|
||||
int (*labashka)(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void),
|
||||
void (*labashka)(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void),
|
||||
size_t max_size);
|
||||
labashka = (int (*)(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void),
|
||||
labashka = (void (*)(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void),
|
||||
size_t max_size))dlsym(module, "labashka");
|
||||
|
||||
stack_init_callback(stack);
|
||||
|
@ -6,9 +6,8 @@
|
||||
// or
|
||||
// cc -shared -fPIC native_test.c -o native_test.dll
|
||||
|
||||
int labashka(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void), size_t max_size ) {
|
||||
void labashka(unsigned short (*pop)(void), void (*push)(unsigned short), size_t (*len)(void), size_t max_size ) {
|
||||
printf("At %zu, there's %d.\n", len(), pop());
|
||||
push(12);
|
||||
printf("Maximum size is %zu.\n", max_size);
|
||||
return 0;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user