fix: build on Windows

This commit is contained in:
2024-01-19 15:56:45 +01:00
parent 0abe351697
commit 56044d8dc0
7 changed files with 84 additions and 19 deletions

View File

@@ -28,7 +28,7 @@ void api_put() {
void api_getasynckeystate() {
#ifdef _WIN32
eax = GetAsyncKeyState(state->STACK[STACK_IDX--]);
state->registers->eax = GetAsyncKeyState(state->STACK[state->STACK_IDX--]);
#else
state->STACK_IDX--;
state->registers->eax = 1;

View File

@@ -7,7 +7,11 @@
FILE *fstream = NULL;
void show_error(size_t line, char *line_) {
#ifdef _WIN32
int wrote = fprintf(fstream, "%ud| ", line + 1);
#else
int wrote = fprintf(fstream, "%ld| ", line + 1);
#endif
fprintf(fstream, "%s\n", line_);
fprintf(fstream, "%*s\n", wrote + 1, "^");
fprintf(fstream, "%*s\n", wrote + 1, "|");