[v3,3/7] pci: build on Windows

Message ID 20200507121646.624-4-talshn@mellanox.com (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Windows bus/pci support |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation fail apply issues

Commit Message

Tal Shnaiderman May 7, 2020, 12:16 p.m. UTC
  From: Tal Shnaiderman <talshn@mellanox.com>

Added off_t in Windows header file as a supported
type since it is needed by PCI.

Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
---
 lib/librte_eal/windows/include/rte_os.h | 1 +
 lib/meson.build                         | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)
  

Comments

Dmitry Kozlyuk May 7, 2020, 11:27 p.m. UTC | #1
On 2020-05-07 15:16 GMT+0300 talshn@mellanox.com wrote:
> From: Tal Shnaiderman <talshn@mellanox.com>
> 
> Added off_t in Windows header file as a supported
> type since it is needed by PCI.
> 
> Signed-off-by: Tal Shnaiderman <talshn@mellanox.com>
> ---
>  lib/librte_eal/windows/include/rte_os.h | 1 +
>  lib/meson.build                         | 5 ++++-
>  2 files changed, 5 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h
> index 62805a307..1c433b976 100644
> --- a/lib/librte_eal/windows/include/rte_os.h
> +++ b/lib/librte_eal/windows/include/rte_os.h
> @@ -48,6 +48,7 @@ extern "C" {
>  
>  /* as in <windows.h> */
>  typedef long long ssize_t;
> +typedef long off_t;

Windows actually has off_t in <sys/types.h>, where it is by POSIX. Shouldn't
rte_pci.h include <sys/types.h> instead? IMO, shims should be kept at minimum.
  

Patch

diff --git a/lib/librte_eal/windows/include/rte_os.h b/lib/librte_eal/windows/include/rte_os.h
index 62805a307..1c433b976 100644
--- a/lib/librte_eal/windows/include/rte_os.h
+++ b/lib/librte_eal/windows/include/rte_os.h
@@ -48,6 +48,7 @@  extern "C" {
 
 /* as in <windows.h> */
 typedef long long ssize_t;
+typedef long off_t;
 
 #ifndef RTE_TOOLCHAIN_GCC
 static inline int
diff --git a/lib/meson.build b/lib/meson.build
index e48efb519..ccb1426ff 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -35,7 +35,10 @@  libraries = [
 	'flow_classify', 'bpf', 'graph', 'node', 'telemetry']
 
 if is_windows
-	libraries = ['kvargs','eal'] # only supported libraries for windows
+	libraries = [
+		'kvargs','eal',
+		'pci',
+	] # only supported libraries for windows
 endif
 
 default_cflags = machine_args