From 4b641b92a7dc1195736ebda823ef12571b95cc51 Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 8 Aug 2020 13:34:59 -0300 Subject: [PATCH 1/3] Fix build for slirp, closes #960 --- src/include/tinyglib.h | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/src/include/tinyglib.h b/src/include/tinyglib.h index fd97ebde5..5c279a576 100644 --- a/src/include/tinyglib.h +++ b/src/include/tinyglib.h @@ -111,11 +111,21 @@ typedef struct _GRand { /* Functions */ -/* Inlining everything is not the best idea, but it keeps TinyGLib - contained to this header file without producing compiler warnings. */ + +#ifdef __GNUC__ +static gboolean g_spawn_async_with_fds(const gchar *working_directory, gchar **argv, + gchar **envp, GSpawnFlags flags, + GSpawnChildSetupFunc child_setup, + gpointer user_data, GPid *child_pid, gint stdin_fd, + gint stdout_fd, gint stderr_fd, GError **error) __attribute__((__unused__)); +static GString *g_string_new(gchar *base) __attribute__((__unused__)); +static gchar *g_string_free(GString *string, gboolean free_segment) __attribute__((__unused__)); +static gchar *g_strstr_len(const gchar *haystack, gssize haystack_len, const gchar *needle) __attribute__((__unused__)); +static guint g_strv_length(gchar **str_array) __attribute__((__unused__)); +#endif /* Must be a function, as libslirp redefines it as a macro. */ -inline gboolean +static gboolean g_spawn_async_with_fds(const gchar *working_directory, gchar **argv, gchar **envp, GSpawnFlags flags, GSpawnChildSetupFunc child_setup, @@ -127,7 +137,7 @@ g_spawn_async_with_fds(const gchar *working_directory, gchar **argv, /* Needs bounds checking, but not really used by libslirp. */ -inline GString * +static GString * g_string_new(gchar *base) { char *ret = malloc(4096); @@ -137,7 +147,8 @@ g_string_new(gchar *base) } -inline gchar * +/* Unimplemented, as with anything related to GString. */ +static gchar * g_string_free(GString *string, gboolean free_segment) { return (free_segment ? NULL : string); @@ -145,7 +156,7 @@ g_string_free(GString *string, gboolean free_segment) /* Implementation borrowed from GLib itself. */ -inline gchar * +static gchar * g_strstr_len(const gchar *haystack, gssize haystack_len, const gchar *needle) { if (haystack_len < 0) @@ -182,7 +193,7 @@ next: /* Implementation borrowed from GLib itself. */ -inline guint +static guint g_strv_length(gchar **str_array) { guint i = 0; From 51e7c6ca587a41c253fc3ab62dcea6c5a16438ad Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 8 Aug 2020 13:37:39 -0300 Subject: [PATCH 2/3] Small cosmetic fix to tinyglib --- src/include/tinyglib.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/include/tinyglib.h b/src/include/tinyglib.h index 5c279a576..01bb08cf7 100644 --- a/src/include/tinyglib.h +++ b/src/include/tinyglib.h @@ -45,7 +45,7 @@ # define G_BYTE_ORDER G_PDP_ENDIAN # endif #endif -#if !defined(G_BYTE_ORDER) +#ifndef G_BYTE_ORDER /* Safe to assume LE for MSVC, as Windows is LE on all architectures. */ # define G_BYTE_ORDER G_LITTLE_ENDIAN #endif From da470860f1bc8e12c71f7305176b07791570623a Mon Sep 17 00:00:00 2001 From: RichardG867 Date: Sat, 8 Aug 2020 13:38:36 -0300 Subject: [PATCH 3/3] Fix makefile typo --- src/win/Makefile.mingw | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/win/Makefile.mingw b/src/win/Makefile.mingw index 5ef621e5e..e2281d55a 100644 --- a/src/win/Makefile.mingw +++ b/src/win/Makefile.mingw @@ -48,7 +48,7 @@ ifeq ($(DEV_BUILD), y) ifndef CYRIX_6X86 CYRIX_6X86 := y endif - ifndef HEADAKA + ifndef HEDAKA HEDAKA := y endif ifndef LASERXT