aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2023-01-01 19:52:16 +0100
committerMartin Mares <mj@ucw.cz>2024-02-18 14:13:41 +0100
commit6aba380e7e51a54d4a4eb529afb2eeada313295b (patch)
tree1e602a8864ffdb1cac81929f17117ff0a72afe74
parentbe40c4738eef9d1283207e62f539c52a5315c10c (diff)
downloadpciutils-6aba380e7e51a54d4a4eb529afb2eeada313295b.tar.gz
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.
-rw-r--r--lib/i386-io-windows.h8
1 files 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 <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