From: Pali Rohár Date: Sun, 1 Jan 2023 18:52:16 +0000 (+0100) Subject: windows: Make msvc __readeflags more readable X-Git-Tag: v3.11.0~27 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=6aba380e7e51a54d4a4eb529afb2eeada313295b;p=pciutils.git 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. --- 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