changeset 2215:a8af8d898a7c

Fix windows build for real
author Michael Pavone <pavone@retrodev.com>
date Tue, 30 Aug 2022 00:13:55 -0700
parents 7591c67b8d1e
children 4e27c36f947c
files cdd_mcu.c cdimage.c controller_info.c event_log.h system.h util.c
diffstat 6 files changed, 19 insertions(+), 12 deletions(-) [+]
line wrap: on
line diff
--- 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 <stdlib.h>
+#include <string.h>
 #include "cdd_mcu.h"
 #include "backend.h"
 
--- 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 <ctype.h>
 #include <string.h>
+#include <stdlib.h>
 
 #include "system.h"
 #include "util.h"
--- 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 <string.h>
 #include <stdlib.h>
+#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)
--- 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;
--- 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;
--- 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");
 		}
 	}