From 6aba380e7e51a54d4a4eb529afb2eeada313295b Mon Sep 17 00:00:00 2001 From: Pali Rohár Date: Sun, 1 Jan 2023 19:52:16 +0100 Subject: windows: Make msvc __readeflags more readable Semicolon in msvc __asm block means start of the comment, and not end of the __asm statement, like it is for all other C statements. Also function which uses msvc inline assembly cannot be inlined to another function (compiler reports a warning about it, not a fatal error). So add explicit curly brackets for __asm block, remove misleading semicolons and do not declare function as inline. --- lib/i386-io-windows.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h index fd4030d..c181b4f 100644 --- a/lib/i386-io-windows.h +++ b/lib/i386-io-windows.h @@ -32,11 +32,13 @@ #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || (__GNUC__ > 4)) #include #elif defined(_MSC_VER) && defined(_M_IX86) -static inline unsigned int +static unsigned int __readeflags(void) { - __asm pushfd; - __asm pop eax; + __asm { + pushfd + pop eax + } } #elif defined(__GNUC__) static inline unsigned -- cgit 1.2.3-korg