eal/windows: add wrappers for string functions
Updated rte_common.h to include rte_os.h to contain OS specific macros and functions. Updated rte_string_fns.h to include rte_common.h for rte_os.h Signed-off-by: Anand Rawat <anand.rawat@intel.com> Reviewed-by: Pallavi Kadam <pallavi.kadam@intel.com> Reviewed-by: Ranjit Menon <ranjit.menon@intel.com> Acked-by: Harini Ramakrishnan <harini.ramakrishnan@microsoft.com>
This commit is contained in:
parent
428eb983f5
commit
58836e93f5
@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2010-2014 Intel Corporation
|
||||
* Copyright(c) 2010-2019 Intel Corporation
|
||||
*/
|
||||
|
||||
#ifndef _RTE_COMMON_H_
|
||||
@ -24,6 +24,9 @@ extern "C" {
|
||||
|
||||
#include <rte_config.h>
|
||||
|
||||
/* OS specific include */
|
||||
#include <rte_os.h>
|
||||
|
||||
#ifndef typeof
|
||||
#define typeof __typeof__
|
||||
#endif
|
||||
|
@ -1,5 +1,5 @@
|
||||
/* SPDX-License-Identifier: BSD-3-Clause
|
||||
* Copyright(c) 2010-2014 Intel Corporation
|
||||
* Copyright(c) 2010-2019 Intel Corporation
|
||||
*/
|
||||
|
||||
/**
|
||||
@ -18,6 +18,8 @@ extern "C" {
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#include <rte_common.h>
|
||||
|
||||
/**
|
||||
* Takes string "string" parameter and splits it at character "delim"
|
||||
* up to maxtokens-1 times - to give "maxtokens" resulting tokens. Like
|
||||
|
@ -11,4 +11,23 @@
|
||||
* Windows OS. Functions will be added in future releases.
|
||||
*/
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include <BaseTsd.h>
|
||||
|
||||
#define strerror_r(a, b, c) strerror_s(b, c, a)
|
||||
|
||||
/* strdup is deprecated in Microsoft libc and _strdup is preferred */
|
||||
#define strdup(str) _strdup(str)
|
||||
|
||||
typedef SSIZE_T ssize_t;
|
||||
|
||||
#define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* _RTE_OS_H_ */
|
||||
|
Loading…
x
Reference in New Issue
Block a user