From 2231388f21ada57fdc745af9c2e2ed6ec41ead8d Mon Sep 17 00:00:00 2001 From: Tal Shnaiderman Date: Wed, 21 Apr 2021 19:09:42 +0300 Subject: [PATCH] eal/windows: fix MinGW build the strncasecmp macro defined in rte_os_shim.h is already defined in MinGW-w64, as a result the compiler prints out the warning below on function redefinition whenever compiling a file including the header in debug mode. lib/eal/windows/include/rte_os_shim.h:21: warning: "strncasecmp" redefined Fixed by defining the macro only to the clang compiler. Fixes: 45d62067c237 ("eal: make OS shims internal") Signed-off-by: Tal Shnaiderman Acked-by: Dmitry Kozlyuk --- lib/eal/windows/include/rte_os_shim.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/eal/windows/include/rte_os_shim.h b/lib/eal/windows/include/rte_os_shim.h index 433fa02c43..1b314733b2 100644 --- a/lib/eal/windows/include/rte_os_shim.h +++ b/lib/eal/windows/include/rte_os_shim.h @@ -20,7 +20,9 @@ #define strdup(str) _strdup(str) #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr) +#ifndef RTE_TOOLCHAIN_GCC #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count) +#endif #define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__) #define read(fd, buf, n) _read(fd, buf, n) -- 2.20.1