diff options
author | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-05-13 16:23:10 +0200 |
---|---|---|
committer | Samuel Thibault <samuel.thibault@ens-lyon.org> | 2022-05-13 16:23:10 +0200 |
commit | 2d763d213865e916092d4065fbe5bc206f30e32f (patch) | |
tree | fd9583c48a7bf9e5b43ab7bf5fd02e9381e5a632 | |
parent | 3ee97215ab2479e998071d7b4d1911de794a3107 (diff) | |
download | slirp-msvc.zip slirp-msvc.tar.gz slirp-msvc.tar.bz2 |
vmstate: only enable when building under GNU Cmsvc
To be able to use typeof.
Fixes #24604
-rw-r--r-- | src/state.c | 4 | ||||
-rw-r--r-- | src/vmstate.c | 4 | ||||
-rw-r--r-- | src/vmstate.h | 7 |
3 files changed, 14 insertions, 1 deletions
diff --git a/src/state.c b/src/state.c index 8708547..770711c 100644 --- a/src/state.c +++ b/src/state.c @@ -26,6 +26,8 @@ #include "vmstate.h" #include "stream.h" +#ifdef HAVE_VMSTATE + static int slirp_tcp_post_load(void *opaque, int version) { tcp_template((struct tcpcb *)opaque); @@ -377,3 +379,5 @@ int slirp_state_version(void) { return 4; } + +#endif /* HAVE_VMSTATE */ diff --git a/src/vmstate.c b/src/vmstate.c index 68cc172..c7fc5a3 100644 --- a/src/vmstate.c +++ b/src/vmstate.c @@ -45,6 +45,8 @@ #include "stream.h" #include "vmstate.h" +#ifdef HAVE_VMSTATE + static int get_nullptr(SlirpIStream *f, void *pv, size_t size, const VMStateField *field) { @@ -442,3 +444,5 @@ int slirp_vmstate_load_state(SlirpIStream *f, const VMStateDescription *vmsd, } return ret; } + +#endif /* HAVE_VMSTATE */ diff --git a/src/vmstate.h b/src/vmstate.h index e3e2459..64dd256 100644 --- a/src/vmstate.h +++ b/src/vmstate.h @@ -39,6 +39,9 @@ #ifndef VMSTATE_H_ #define VMSTATE_H_ +#ifdef __GNUC__ +#define HAVE_VMSTATE 1 + #include <unistd.h> #include <stdint.h> #include <stdbool.h> @@ -392,4 +395,6 @@ extern const VMStateInfo slirp_vmstate_info_tmp; .flags = VMS_END, \ } -#endif +#endif /* __GNUC__ */ + +#endif /* VMSTATE_H_ */ |