From: Pali Rohár Date: Sun, 26 Dec 2021 17:18:59 +0000 (+0100) Subject: lib: Fix definition of strcasecmp() for PCI_OS_WINDOWS X-Git-Tag: v3.8.0~66 X-Git-Url: http://mj.ucw.cz/gitweb/?a=commitdiff_plain;h=959db7be4c603f00de3515ab67b2a481723ebe81;p=pciutils.git 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. --- 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