aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPali Rohár <pali@kernel.org>2021-12-26 18:18:59 +0100
committerMartin Mares <mj@ucw.cz>2021-12-28 16:26:50 +0100
commit959db7be4c603f00de3515ab67b2a481723ebe81 (patch)
tree95677b6d67bd562c835000339cbbb28a3023941c
parentdce0da6171f039d151f7a85db5a44ed57e20fcdf (diff)
downloadpciutils-959db7be4c603f00de3515ab67b2a481723ebe81.tar.gz
lib: Fix definition of strcasecmp() for PCI_OS_WINDOWS
UCRT, MSVCRT and CRTDLL runtime libraries provides only _strcmpi() function and not strcmpi(). MinGW32 has static libraries libcoldname.a and libmoldname.a which provides strcmpi() function (as link-time redirect to _strcmpi()). libcoldname.a is automatically linked when compiling for CRTDLL runtime and libmoldname.a for MSVCRT runtime. MinGW-w64 has only libmoldname.a library with strcmpi() function and it is linked to final executable only when compiling for MSVCRT runtime. when linking with MSVCRT. To prevent dependency on particular linking configuration and MinGW toolchain, use set strcasecmp() as alias to _strcmpi() function which is provided by any runtime library.
-rw-r--r--lib/sysdep.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/sysdep.h b/lib/sysdep.h
index 1a5cb16..c6c248e 100644
--- a/lib/sysdep.h
+++ b/lib/sysdep.h
@@ -21,7 +21,7 @@ typedef u8 byte;
typedef u16 word;
#ifdef PCI_OS_WINDOWS
-#define strcasecmp strcmpi
+#define strcasecmp _strcmpi
#endif
#ifdef PCI_HAVE_LINUX_BYTEORDER_H