diff options
author | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-30 10:44:38 +0200 |
---|---|---|
committer | Marc-André Lureau <marcandre.lureau@redhat.com> | 2022-05-30 10:50:16 +0200 |
commit | e7362700bc5146689455f6a29d5f5f0fbd037285 (patch) | |
tree | caefd471caedb77b536cb96d4fc31ab3bff7293e | |
parent | dddb2be9e60531f232bb9eb44c25e810112cbe42 (diff) | |
download | slirp-e7362700bc5146689455f6a29d5f5f0fbd037285.zip slirp-e7362700bc5146689455f6a29d5f5f0fbd037285.tar.gz slirp-e7362700bc5146689455f6a29d5f5f0fbd037285.tar.bz2 |
msvc: enable vmstate code on !gnuc
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
-rw-r--r-- | src/vmstate.h | 13 |
1 files changed, 7 insertions, 6 deletions
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_ */ |