From: Pali Rohár Date: Sat, 16 Apr 2022 15:23:45 +0000 (+0200) Subject: libpci: i386-io-windows.h: Do not define __readeflags() for GCC 4.9+ X-Git-Tag: v3.9.0~18^2 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=01ecaf9e3a515895d9eec85bc954412a6d0d7d97;p=pciutils.git libpci: i386-io-windows.h: Do not define __readeflags() for GCC 4.9+ GCC header file defines static inline function __readeflags() which calls correct __builtin_ia32_readeflags_XX() builtin. Header file is included by MinGW-w64's header file in new versions of MinGW-w64 and may be included transitionally by some other header files automatically. Defining __readeflags() as both macro and static inline function cause compile errors. Fix this compile error by not defining __readeflags() macro and instead include GCC header file . --- diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h index ac2a55d..1509d7d 100644 --- a/lib/i386-io-windows.h +++ b/lib/i386-io-windows.h @@ -107,16 +107,13 @@ unsigned long _inpd(unsigned short port); * function conflicts with some MSVC intrinsic. * MSVC supports inline assembly via __asm keyword in 32-bit mode only. * GCC version 4.9.0 and higher provides __builtin_ia32_readeflags_uXX() - * builtin for XX-mode. + * builtin for XX-mode. This builtin is also available as __readeflags() + * function indirectly via header file. */ #if defined(_MSC_VER) && (_MSC_VER >= 1500 || (_MSC_VER >= 1400 && defined(__BUILDMACHINE__))) #pragma intrinsic(__readeflags) #elif defined(__GNUC__) && ((__GNUC__ == 4 && __GNUC_MINOR__ >= 9) || (__GNUC__ > 4)) -#ifdef __x86_64__ -#define __readeflags() __builtin_ia32_readeflags_u64() -#else -#define __readeflags() __builtin_ia32_readeflags_u32() -#endif +#include #elif defined(_MSC_VER) && defined(_M_IX86) static inline unsigned int __readeflags(void)