[v9,02/10] eal/windows: add necessary macros

Message ID 1619805162-10684-3-git-send-email-jizh@linux.microsoft.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series app/testpmd: enable testpmd on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Jie Zhou April 30, 2021, 5:52 p.m. UTC
  Add required macros by testpmd on Windows in rte_os_shim.h

Signed-off-by: Jie Zhou <jizh@microsoft.com>
Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
---
 lib/eal/windows/include/rte_os_shim.h | 9 +++++++++
 1 file changed, 9 insertions(+)
  

Comments

Tal Shnaiderman May 3, 2021, 5:36 p.m. UTC | #1
> Subject: [PATCH v9 02/10] eal/windows: add necessary macros
> 
> External email: Use caution opening links or attachments
> 
> 
> Add required macros by testpmd on Windows in rte_os_shim.h
> 
> Signed-off-by: Jie Zhou <jizh@microsoft.com>
> Signed-off-by: Jie Zhou <jizh@linux.microsoft.com>
> ---
>  lib/eal/windows/include/rte_os_shim.h | 9 +++++++++
>  1 file changed, 9 insertions(+)
> 
> diff --git a/lib/eal/windows/include/rte_os_shim.h
> b/lib/eal/windows/include/rte_os_shim.h
> index 433fa02c4..e60f27400 100644
> --- a/lib/eal/windows/include/rte_os_shim.h
> +++ b/lib/eal/windows/include/rte_os_shim.h
> @@ -20,6 +20,7 @@
> 
>  #define strdup(str) _strdup(str)
>  #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
> +#define strcasecmp _stricmp
>  #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
> 
>  #define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__) @@ -
> 36,6 +37,14 @@
>  #define IPPROTO_SCTP   132
>  #endif
> 
> +#ifndef IPDEFTTL
> +#define IPDEFTTL 64
> +#endif
> +
> +#ifndef S_ISREG
> +#define S_ISREG(mode)  (((mode)&S_IFMT) == S_IFREG) #endif
> +
>  #ifdef RTE_TOOLCHAIN_GCC
> 
>  #define TIME_UTC 1
> --
> 2.30.0.vfs.0.2

Acked-by: Tal Shnaiderman <talshn@nvidia.com>
  

Patch

diff --git a/lib/eal/windows/include/rte_os_shim.h b/lib/eal/windows/include/rte_os_shim.h
index 433fa02c4..e60f27400 100644
--- a/lib/eal/windows/include/rte_os_shim.h
+++ b/lib/eal/windows/include/rte_os_shim.h
@@ -20,6 +20,7 @@ 
 
 #define strdup(str) _strdup(str)
 #define strtok_r(str, delim, saveptr) strtok_s(str, delim, saveptr)
+#define strcasecmp _stricmp
 #define strncasecmp(s1, s2, count) _strnicmp(s1, s2, count)
 
 #define open(path, flags, ...) _open(path, flags, ##__VA_ARGS__)
@@ -36,6 +37,14 @@ 
 #define IPPROTO_SCTP	132
 #endif
 
+#ifndef IPDEFTTL
+#define IPDEFTTL 64
+#endif
+
+#ifndef S_ISREG
+#define S_ISREG(mode)  (((mode)&S_IFMT) == S_IFREG)
+#endif
+
 #ifdef RTE_TOOLCHAIN_GCC
 
 #define TIME_UTC 1