Remove unistd.h from uxnemu.c.

This commit is contained in:
Andrew Alderwick 2022-01-11 23:50:41 +00:00
parent 5e2bb92e4c
commit b1ba95336c
1 changed files with 7 additions and 4 deletions

View File

@ -1,5 +1,4 @@
#include <stdio.h> #include <stdio.h>
#include <unistd.h>
#include <time.h> #include <time.h>
#include "uxn.h" #include "uxn.h"
@ -90,7 +89,7 @@ stdin_handler(void *p)
{ {
SDL_Event event; SDL_Event event;
event.type = stdin_event; event.type = stdin_event;
while(read(0, &event.cbutton.button, 1) > 0) while(fread(&event.cbutton.button, 1, 1, stdin) > 0)
SDL_PushEvent(&event); SDL_PushEvent(&event);
return 0; return 0;
(void)p; (void)p;
@ -183,8 +182,12 @@ system_deo_special(Device *d, Uint8 port)
static void static void
console_deo(Device *d, Uint8 port) console_deo(Device *d, Uint8 port)
{ {
if(port > 0x7) FILE *fd = port == 0x8 ? stdout : port == 0x9 ? stderr
write(port - 0x7, (char *)&d->dat[port], 1); : 0;
if(fd) {
fputc(d->dat[port], fd);
fflush(fd);
}
} }
static Uint8 static Uint8