]> mj.ucw.cz Git - pciutils.git/commitdiff
libpci: For PCI_OS_WINDOWS define strncasecmp as alias for _strnicmp
authorPali Rohár <pali@kernel.org>
Sun, 26 Dec 2021 21:11:22 +0000 (22:11 +0100)
committerMartin Mares <mj@ucw.cz>
Thu, 10 Feb 2022 11:58:17 +0000 (12:58 +0100)
CRTDLL, MSVCRT and UCRT runtimes provides strncasecmp()-like functionality
in _strnicmp() function. As opposite of strcasecmp() for which there are
_stricmp() and _strcmpi() variants, for strncasecmp() there is only
_strnicmp() function.

Without this change linking final setpci.exe executable undef MSVC fails.

lib/sysdep.h

index 1986d9f41c59d0f4a60ec4c88be022f16de0c2e0..bdeb34a193f9d6b22479dd5d58a6da3eb7afa4ff 100644 (file)
@@ -22,6 +22,7 @@ typedef u16 word;
 
 #ifdef PCI_OS_WINDOWS
 #define strcasecmp _strcmpi
+#define strncasecmp _strnicmp
 #if defined(_MSC_VER) && _MSC_VER < 1900
 #define snprintf _snprintf
 #define vsnprintf _vsnprintf