1 /* SPDX-License-Identifier: BSD-3-Clause
2 * Copyright(c) 2010-2019 Intel Corporation
9 * This is header should contain any function/macro definition
10 * which are not supported natively or named differently in the
11 * Windows OS. It must not include Windows-specific headers.
22 /* limits.h replacement, value as in <windows.h> */
24 #define PATH_MAX _MAX_PATH
27 #define strerror_r(a, b, c) strerror_s(b, c, a)
29 /* strdup is deprecated in Microsoft libc and _strdup is preferred */
30 #define strdup(str) _strdup(str)
32 #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
34 #define index(a, b) strchr(a, b)
35 #define rindex(a, b) strrchr(a, b)
37 #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
39 /* cpu_set macros implementation */
40 #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
41 #define RTE_CPU_OR(dst, src1, src2) CPU_OR(dst, src1, src2)
42 #define RTE_CPU_FILL(set) CPU_FILL(set)
43 #define RTE_CPU_NOT(dst, src) CPU_NOT(dst, src)
45 /* as in <windows.h> */
46 typedef long long ssize_t;
48 #ifndef RTE_TOOLCHAIN_GCC
50 asprintf(char **buffer, const char *format, ...)
55 va_start(arg, format);
56 size = vsnprintf(NULL, 0, format, arg);
62 *buffer = malloc(size);
66 va_start(arg, format);
67 ret = vsnprintf(*buffer, size, format, arg);
69 if (ret != size - 1) {
75 #endif /* RTE_TOOLCHAIN_GCC */
81 #endif /* _RTE_OS_H_ */