diff options
-rw-r--r-- | src/misc.c | 4 | ||||
-rw-r--r-- | src/vmstate.h | 13 |
2 files changed, 11 insertions, 6 deletions
@@ -147,8 +147,10 @@ static void fork_exec_child_setup(gpointer data) #endif } +#ifdef __GNUC__ #pragma GCC diagnostic push #pragma GCC diagnostic ignored "-Wdeprecated-declarations" +#endif #if !GLIB_CHECK_VERSION(2, 58, 0) typedef struct SlirpGSpawnFds { @@ -198,7 +200,9 @@ g_spawn_async_with_fds_slirp(const gchar *working_directory, gchar **argv, #define g_spawn_async_with_fds(wd, argv, env, f, c, d, p, ifd, ofd, efd, err) \ g_spawn_async_with_fds_slirp(wd, argv, env, f, c, d, p, ifd, ofd, efd, err) +#ifdef __GNUC__ #pragma GCC diagnostic pop +#endif int fork_exec(struct socket *so, const char *ex) { diff --git a/src/vmstate.h b/src/vmstate.h index 64dd256..cd77c85 100644 --- a/src/vmstate.h +++ b/src/vmstate.h @@ -39,10 +39,6 @@ #ifndef VMSTATE_H_ #define VMSTATE_H_ -#ifdef __GNUC__ -#define HAVE_VMSTATE 1 - -#include <unistd.h> #include <stdint.h> #include <stdbool.h> #include "slirp.h" @@ -220,10 +216,17 @@ extern const VMStateInfo slirp_vmstate_info_nullptr; extern const VMStateInfo slirp_vmstate_info_buffer; extern const VMStateInfo slirp_vmstate_info_tmp; +#ifdef __GNUC__ #define type_check_array(t1, t2, n) ((t1(*)[n])0 - (t2 *)0) #define type_check_pointer(t1, t2) ((t1 **)0 - (t2 *)0) #define typeof_field(type, field) typeof(((type *)0)->field) #define type_check(t1, t2) ((t1 *)0 - (t2 *)0) +#else +#define type_check_array(t1, t2, n) 0 +#define type_check_pointer(t1, t2) 0 +#define typeof_field(type, field) (((type *)0)->field) +#define type_check(t1, t2) 0 +#endif #define vmstate_offset_value(_state, _field, _type) \ (offsetof(_state, _field) + type_check(_type, typeof_field(_state, _field))) @@ -395,6 +398,4 @@ extern const VMStateInfo slirp_vmstate_info_tmp; .flags = VMS_END, \ } -#endif /* __GNUC__ */ - #endif /* VMSTATE_H_ */ |