# HG changeset patch # User Michael Pavone # Date 1661843635 25200 # Node ID a8af8d898a7c86d2af991162c0cc8a145d8d6bf8 # Parent 7591c67b8d1eb6ad19f38568e87bcaa00b5dbb11 Fix windows build for real diff -r 7591c67b8d1e -r a8af8d898a7c cdd_mcu.c --- a/cdd_mcu.c Mon Aug 29 23:01:46 2022 -0700 +++ b/cdd_mcu.c Tue Aug 30 00:13:55 2022 -0700 @@ -1,3 +1,5 @@ +#include +#include #include "cdd_mcu.h" #include "backend.h" diff -r 7591c67b8d1e -r a8af8d898a7c cdimage.c --- a/cdimage.c Mon Aug 29 23:01:46 2022 -0700 +++ b/cdimage.c Tue Aug 30 00:13:55 2022 -0700 @@ -1,5 +1,6 @@ #include #include +#include #include "system.h" #include "util.h" diff -r 7591c67b8d1e -r a8af8d898a7c controller_info.c --- a/controller_info.c Mon Aug 29 23:01:46 2022 -0700 +++ b/controller_info.c Tue Aug 30 00:13:55 2022 -0700 @@ -1,5 +1,6 @@ #include #include +#include "render.h" #ifndef USE_FBDEV #include "render_sdl.h" #endif @@ -204,7 +205,7 @@ info_config = tern_insert_node(info_config, guid_string, existing); persist_config_at(config, info_config, "controller_types.cfg"); handle_joy_added(joystick); -#endif +#endif } void save_controller_mapping(int joystick, char *mapping_string) diff -r 7591c67b8d1e -r a8af8d898a7c event_log.h --- a/event_log.h Mon Aug 29 23:01:46 2022 -0700 +++ b/event_log.h Tue Aug 30 00:13:55 2022 -0700 @@ -21,7 +21,7 @@ #include "serialize.h" #include "zlib/zlib.h" -typedef struct { +typedef struct event_reader { size_t storage; uint8_t *socket_buffer; size_t socket_buffer_size; diff -r 7591c67b8d1e -r a8af8d898a7c system.h --- a/system.h Mon Aug 29 23:01:46 2022 -0700 +++ b/system.h Tue Aug 30 00:13:55 2022 -0700 @@ -37,7 +37,7 @@ #include "arena.h" #include "romdb.h" -#include "event_log.h" +typedef struct event_reader event_reader; struct system_header { system_header *next_context; diff -r 7591c67b8d1e -r a8af8d898a7c util.c --- a/util.c Mon Aug 29 23:01:46 2022 -0700 +++ b/util.c Tue Aug 30 00:13:55 2022 -0700 @@ -28,10 +28,13 @@ #define fatal_printf(msg, args) vfprintf(stderr, msg, args) #endif -#include "blastem.h" //for headless global -#include "render.h" //for render_errorbox #include "util.h" +void render_errorbox(char *title, char *message); +void render_warnbox(char *title, char *message); +void render_infobox(char *title, char *message); +extern int headless; + char * alloc_concat(char const * first, char const * second) { int flen = strlen(first); @@ -349,7 +352,7 @@ char *barename = malloc(lastdot-lastslash+1); memcpy(barename, lastslash, lastdot-lastslash); barename[lastdot-lastslash] = 0; - + return barename; } @@ -407,7 +410,7 @@ char *dir = malloc(lastslash-path+1); memcpy(dir, path, lastslash-path); dir[lastslash-path] = 0; - + return dir; } @@ -630,18 +633,18 @@ } return NULL; } - + size_t storage = 64; ret = malloc(sizeof(dir_entry) * storage); size_t pos = 0; - + if (path[1] == ':' && (!path[2] || (path[2] == PATH_SEP[0] && !path[3]))) { //we are in the root of a drive, add a virtual .. entry //for navigating to the virtual root directory ret[pos].name = strdup(".."); ret[pos++].is_dir = 1; } - + do { if (pos == storage) { storage = storage * 2; @@ -650,7 +653,7 @@ ret[pos].name = strdup(file.cFileName); ret[pos++].is_dir = (file.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY) != 0; } while (FindNextFile(dir, &file)); - + FindClose(dir); if (numret) { *numret = pos; @@ -1074,7 +1077,7 @@ static char* confdir; if (!confdir) { char const *base = get_userdata_dir(); - if (base) { + if (base) { confdir = alloc_concat(base, PATH_SEP "blastem"); } }