1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2019 Intel Corporation
9 * This header should contain any definition
10 * which is not supported natively or named differently in Windows.
21 /* limits.h replacement, value as in <windows.h> */
23 #define PATH_MAX _MAX_PATH
27 #define sleep(x) Sleep(1000 * (x))
31 #define strerror_r(a, b, c) strerror_s(b, c, a)
35 /* strdup is deprecated in Microsoft libc and _strdup is preferred */
36 #define strdup(str) _strdup(str)
40 #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
44 #define index(a, b) strchr(a, b)
48 #define rindex(a, b) strrchr(a, b)
52 #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
60 #define unlink _unlink
63 /* cpu_set macros implementation */
64 #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
65 #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)
66 #define RTE_CPU_FILL(set) CPU_FILL(set)
67 #define RTE_CPU_NOT(dst, src) CPU_NOT(dst, src)
69 /* as in <windows.h> */
70 typedef long long ssize_t;
72 #ifndef RTE_TOOLCHAIN_GCC
73 static inline const char *
74 eal_strerror(int code)
76 static char buffer[128];
78 strerror_s(buffer, sizeof(buffer), code);
83 #define strerror eal_strerror
85 #endif /* RTE_TOOLCHAIN_GCC */
91 #endif /* _RTE_OS_H_ */