]> mj.ucw.cz Git - pciutils.git/commitdiff
windows: Make msvc __readeflags more readable
authorPali Rohár <pali@kernel.org>
Sun, 1 Jan 2023 18:52:16 +0000 (19:52 +0100)
committerMartin Mares <mj@ucw.cz>
Sun, 18 Feb 2024 13:13:41 +0000 (14:13 +0100)
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

index fd4030d9e7125942c58d4f12fe45ea39b99b0e81..c181b4f4d7692bed663f09c063bd19e6038e51d8 100644 (file)
 #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || (__GNUC__ > 4))
 #include <x86intrin.h>
 #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