add sleep() function and improve Windows support

I could only test Windows support by compiling with gcc MinGW-w64 and
running with Wine.
This commit is contained in:
r4
2021-12-25 14:06:20 +01:00
parent dd67a1bf5d
commit b4c369e1d9
5 changed files with 46 additions and 6 deletions

10
util.h
View File

@@ -6,7 +6,13 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#ifdef WIN32
#include <windows.h> /* SSIZE_T */
typedef SSIZE_T ssize_t;
#else
#include <unistd.h> /* ssize_t */
#endif
typedef uint8_t pseudo_void;
@@ -29,6 +35,8 @@ typedef uint8_t pseudo_void;
#define C_RESET "\x1b[m"
void sleep_secs(double secs);
#define ERRSZ 4096
extern char errbuf[ERRSZ];
extern bool err;