qemu-patch-raspberry4/include/sysemu
Daniel P. Berrange c619644067 osdep: fix socket_error() to work with Mingw64
Historically QEMU has had a socket_error() macro that was
defined to map to WSASocketError(). The os-win32.h header
file would define errno constants that mapped to the
WSA error constants. This worked fine with Mingw32 since
its header files never defined any errno values, nor did
it even provide an errno.h.  So callers of socket_error()
could match on traditional Exxxx constants and it would
all "just work".

With Mingw64 though, things work rather differently. First
there is an errno.h file which defines all the traditional
errno constants you'd expect from a UNIX platform. There
is then a winerror.h which defined the WSA error constants.
Crucially the WSAExxxx errno values in winerror.h do not
match the Exxxx errno values in error.h.

If QEMU had only imported winerror.h it would still work,
but the qemu/osdep.h file unconditionally imports errno.h.
So callers of socket_error() will get now WSAExxxx values
back and compare them to the Exxx constants. This will
always fail silently at runtime.

To solve this QEMU needs to stop assuming the WSAExxxx
constant values match the Exxx constant values. Thus the
socket_error() macro is turned into a small function that
re-maps WSAExxxx values into Exxx.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Daniel P. Berrange <berrange@redhat.com>
2016-03-10 17:10:17 +00:00
..
accel.h accel: Pass MachineState object to accel init functions 2014-10-09 12:57:10 +02:00
arch_init.h migration: move ram stuff to migration/ram 2015-06-12 06:40:59 +02:00
balloon.h Inhibit ballooning during postcopy 2015-11-10 15:00:28 +01:00
block-backend.h include: Clean up includes 2016-02-23 12:43:05 +00:00
blockdev.h include: Clean up includes 2016-02-23 12:43:05 +00:00
bt.h sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
char.h chardev: Properly initialize ChardevCommon components 2016-02-25 16:11:29 +01:00
cpus.h Revert "Introduce cpu_clean_all_dirty" 2015-11-05 11:28:23 +01:00
device_tree.h device_tree: qemu_fdt_getprop_cell converted to use the error API 2016-02-19 09:42:30 -07:00
dma.h include: Clean up includes 2016-02-23 12:43:05 +00:00
dump-arch.h dump: allow target to set the physical base 2016-01-15 14:40:25 +00:00
dump.h DumpState: adding total_size and written_size fields 2016-02-22 18:40:28 +01:00
hostmem.h include: Clean up includes 2016-02-23 12:43:05 +00:00
iothread.h Remove various unused functions 2015-05-08 14:11:10 +03:00
kvm.h include: Clean up includes 2016-02-23 12:43:05 +00:00
kvm_int.h kvm-all: add support for multiple address spaces 2015-07-06 17:59:43 +02:00
memory_mapping.h dump-guest-memory: add "detach" support 2016-02-22 18:40:28 +01:00
numa.h include: Clean up includes 2016-02-23 12:43:05 +00:00
os-posix.h osdep: fix socket_error() to work with Mingw64 2016-03-10 17:10:17 +00:00
os-win32.h osdep: fix socket_error() to work with Mingw64 2016-03-10 17:10:17 +00:00
qtest.h include: Clean up includes 2016-02-23 12:43:05 +00:00
replay.h include: Clean up includes 2016-02-23 12:43:05 +00:00
rng-random.h sysemu: avoid proliferation of include/ subdirectories 2013-04-15 18:19:25 +02:00
rng.h rng: switch request queue to QSIMPLEQ 2016-03-08 12:54:14 +05:30
seccomp.h include: Clean up includes 2016-02-23 12:43:05 +00:00
sysemu.h Finish non-postcopiable iterative devices before package 2015-11-12 17:52:29 +01:00
tpm.h TPM: fix build with tpm disabled 2015-06-03 18:19:15 +02:00
tpm_backend.h include: Clean up includes 2016-02-23 12:43:05 +00:00
tpm_backend_int.h Remove various unused functions 2015-05-08 14:11:10 +03:00
watchdog.h watchdog: introduction of get_watchdog_action 2016-01-27 15:34:47 +01:00
xen-mapcache.h include: Clean up includes 2016-02-23 12:43:05 +00:00