win32: avoid discarding the exception handler
commit75b773d84c89220463a14a6883d2b2a8e49e5b68
authorMarc-André Lureau <marcandre.lureau@redhat.com>
Mon, 25 Sep 2023 11:36:04 +0000 (25 15:36 +0400)
committerMarc-André Lureau <marcandre.lureau@redhat.com>
Tue, 3 Oct 2023 11:05:20 +0000 (3 15:05 +0400)
tree1a1e526ff9d3004b7852f3901713e6f6033f14b6
parent7db57a73f66463488fbd53fe5f9589de49534fe8
win32: avoid discarding the exception handler

In all likelihood, the compiler with lto doesn't see the function being
used, from assembly macro __try1. Help it by marking the function has
being used.

Resolves:
https://gitlab.com/qemu-project/qemu/-/issues/1904

Fixes: commit d89f30b4df ("win32: wrap socket close() with an exception handler")

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
include/qemu/compiler.h
util/oslib-win32.c