Skip to content

Commit

Permalink
Make Wasm-things link successfully
Browse files Browse the repository at this point in the history
  • Loading branch information
RobDangerous committed Aug 18, 2022
1 parent 01a31be commit ff53786
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 5 deletions.
4 changes: 2 additions & 2 deletions Backends/System/Android/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -1185,7 +1185,7 @@ int kinc_init(const char *name, int width, int height, struct kinc_window_option
return 0;
}

void kinc_internal_shutdown() {}
void kinc_internal_shutdown(void) {}

const char *kinc_gamepad_vendor(int gamepad) {
return "Google";
Expand All @@ -1201,7 +1201,7 @@ static char *externalFilesDir = NULL;

#define CLASS_NAME "android/app/NativeActivity"

void initAndroidFileReader() {
void initAndroidFileReader(void) {
if (activity == NULL) {
kinc_log(KINC_LOG_LEVEL_ERROR, "Android activity is NULL");
return;
Expand Down
6 changes: 6 additions & 0 deletions Backends/System/Wasm/Sources/kinc/backend/system.c.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,4 +45,10 @@ double kinc_time(void) {
return 0.0;
}

void kinc_internal_shutdown(void) {}

extern int kickstart(int argc, char **argv);

__attribute__((export_name("_start"))) void _start(void) {
kickstart(0, NULL);
}
2 changes: 1 addition & 1 deletion Sources/kinc/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ void kinc_internal_logout_callback(void);
#include <stdlib.h>
#include <string.h>

#if !defined(KORE_EMSCRIPTEN) && !defined(KORE_ANDROID) && !defined(KORE_WINDOWS) && !defined(KORE_CONSOLE)
#if !defined(KORE_WASM) && !defined(KORE_EMSCRIPTEN) && !defined(KORE_ANDROID) && !defined(KORE_WINDOWS) && !defined(KORE_CONSOLE)
double kinc_time(void) {
return kinc_timestamp() / kinc_frequency();
}
Expand Down
8 changes: 8 additions & 0 deletions miniClib/stdio.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ size_t fwrite(const void *ptr, size_t size, size_t count, FILE *stream) {
return 0;
}

FILE *fopen(const char *filename, const char *mode) {
return NULL;
}

int fclose(FILE *stream) {
return 0;
}
Expand All @@ -29,3 +33,7 @@ int fseek(FILE *stream, long int offset, int origin) {
size_t fread(void *ptr, size_t size, size_t count, FILE *stream) {
return 0;
}

int fputs(const char *str, FILE *stream) {
return 0;
}
4 changes: 4 additions & 0 deletions miniClib/stdio.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ int vsnprintf(char *s, size_t n, const char *format, va_list arg);

size_t fwrite(const void *ptr, size_t size, size_t count, FILE *stream);

FILE *fopen(const char *filename, const char *mode);

int fclose(FILE *stream);

long int ftell(FILE *stream);
Expand All @@ -28,6 +30,8 @@ int fseek(FILE *stream, long int offset, int origin);

size_t fread(void *ptr, size_t size, size_t count, FILE *stream);

int fputs(const char *str, FILE *stream);

#ifdef __cplusplus
}
#endif
2 changes: 0 additions & 2 deletions miniClib/string.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#pragma once

#include "string.h"

#include <stdbool.h>
Expand Down

0 comments on commit ff53786

Please sign in to comment.