aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2022-02-27 20:02:37 +0100
committerMartin Mareš <mj@ucw.cz>2022-04-15 23:57:52 +0200
commit49b93c5dd9f8ae21533cb0418850a70c12721bf3 (patch)
treeba0e04aa3bcc1a18f55c5642b96e9d765f8c079f
parent5f93596f916038bdb611ca5af351e849f9c02d39 (diff)
downloadpciutils-49b93c5dd9f8ae21533cb0418850a70c12721bf3.tar.gz
libpci: i386-io-windows.h: Fix MinGW build with pre-4.00 MSVCRT runtime library
Like CRTDLL library, pre-4.00 MSVCRT runtime library does not provide I/O port functions.
-rw-r--r--lib/i386-io-windows.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/i386-io-windows.h b/lib/i386-io-windows.h
index 9cd9cd9..e32ecb2 100644
--- a/lib/i386-io-windows.h
+++ b/lib/i386-io-windows.h
@@ -35,11 +35,11 @@
#define _inp(x) __inbyte(x)
#define _inpw(x) __inword(x)
#define _inpd(x) __indword(x)
-#elif defined(__CRTDLL__)
+#elif defined(__CRTDLL__) || (defined(__MSVCRT_VERSION__) && __MSVCRT_VERSION__ < 0x400)
/*
- * Old 32-bit CRTDLL library does not provide I/O port functions. As this
- * library exists only in 32-bit mode variant, implement I/O port functions
- * via 32-bit inline assembly.
+ * Old 32-bit CRTDLL library and pre-4.00 MSVCRT library do not provide I/O
+ * port functions. As these libraries exist only in 32-bit mode variant,
+ * implement I/O port functions via 32-bit inline assembly.
*/
static inline int _outp(unsigned short port, int databyte)
{