[6/8] rib: enable on Windows

Message ID 20221201014440.11896-7-stephen@networkplumber.org (mailing list archive)
State Superseded, archived
Delegated to: Thomas Monjalon
Headers
Series Enable building more on Windows |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Stephen Hemminger Dec. 1, 2022, 1:44 a.m. UTC
  The RIB library builds on Windows as long as sys/queue.h is included

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/test/test_rib.c  | 19 -------------------
 app/test/test_rib6.c | 24 ++----------------------
 lib/rib/meson.build  |  6 ------
 lib/rib/rte_rib.c    |  1 +
 lib/rib/rte_rib6.c   |  1 +
 5 files changed, 4 insertions(+), 47 deletions(-)
  

Comments

Tyler Retzlaff Dec. 1, 2022, 11:54 p.m. UTC | #1
On Wed, Nov 30, 2022 at 05:44:37PM -0800, Stephen Hemminger wrote:
> The RIB library builds on Windows as long as sys/queue.h is included
> 
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
> ---

Acked-by: Tyler Retzlaff <roretzla@linux.microsoft.com>
  

Patch

diff --git a/app/test/test_rib.c b/app/test/test_rib.c
index 06058f8f7c52..65b685641094 100644
--- a/app/test/test_rib.c
+++ b/app/test/test_rib.c
@@ -10,23 +10,6 @@ 
 #include <stdlib.h>
 
 #include <rte_ip.h>
-
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_rib(void)
-{
-	printf("rib not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-static int
-test_slow_rib(void)
-{
-	printf("slow_rib not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-#else
-
 #include <rte_rib.h>
 
 typedef int32_t (*rte_rib_test)(void);
@@ -380,7 +363,5 @@  test_slow_rib(void)
 	return unit_test_suite_runner(&rib_slow_tests);
 }
 
-#endif /* !RTE_EXEC_ENV_WINDOWS */
-
 REGISTER_TEST_COMMAND(rib_autotest, test_rib);
 REGISTER_TEST_COMMAND(rib_slow_autotest, test_slow_rib);
diff --git a/app/test/test_rib6.c b/app/test/test_rib6.c
index ba79aedea5f7..336b779d2e1e 100644
--- a/app/test/test_rib6.c
+++ b/app/test/test_rib6.c
@@ -3,32 +3,14 @@ 
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include "test.h"
-
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-
 #include <rte_ip.h>
-
-#ifdef RTE_EXEC_ENV_WINDOWS
-static int
-test_rib6(void)
-{
-	printf("rib6 not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-
-static int
-test_slow_rib6(void)
-{
-	printf("slow_rib6 not supported on Windows, skipping test\n");
-	return TEST_SKIPPED;
-}
-#else
-
 #include <rte_rib6.h>
 
+#include "test.h"
+
 typedef int32_t (*rte_rib6_test)(void);
 
 static int32_t test_create_invalid(void);
@@ -385,7 +367,5 @@  test_slow_rib6(void)
 	return unit_test_suite_runner(&rib6_slow_tests);
 }
 
-#endif /* !RTE_EXEC_ENV_WINDOWS */
-
 REGISTER_TEST_COMMAND(rib6_autotest, test_rib6);
 REGISTER_TEST_COMMAND(rib6_slow_autotest, test_slow_rib6);
diff --git a/lib/rib/meson.build b/lib/rib/meson.build
index bda7f576e976..7bacbb453592 100644
--- a/lib/rib/meson.build
+++ b/lib/rib/meson.build
@@ -2,12 +2,6 @@ 
 # Copyright(c) 2018 Vladimir Medvedkin <medvedkinv@gmail.com>
 # Copyright(c) 2019 Intel Corporation
 
-if is_windows
-    build = false
-    reason = 'not supported on Windows'
-    subdir_done()
-endif
-
 sources = files('rte_rib.c', 'rte_rib6.c')
 headers = files('rte_rib.h', 'rte_rib6.h')
 deps += ['mempool']
diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c
index b0794edf66f5..812a2597d117 100644
--- a/lib/rib/rte_rib.c
+++ b/lib/rib/rte_rib.c
@@ -5,6 +5,7 @@ 
 
 #include <stdbool.h>
 #include <stdint.h>
+#include <sys/queue.h>
 
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>
diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
index 19e4ff97c479..ae44281ae105 100644
--- a/lib/rib/rte_rib6.c
+++ b/lib/rib/rte_rib6.c
@@ -5,6 +5,7 @@ 
 
 #include <stdbool.h>
 #include <stdint.h>
+#include <sys/queue.h>
 
 #include <rte_eal_memconfig.h>
 #include <rte_errno.h>