From 959db7be4c603f00de3515ab67b2a481723ebe81 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Pali=20Roh=C3=A1r?= Date: Sun, 26 Dec 2021 18:18:59 +0100 Subject: [PATCH] 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. --- lib/sysdep.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 -- 2.39.2