On 5/27/24 15:00, Bruce Richardson wrote:
On Wed, Mar 20, 2024 at 02:33:35PM -0700, Tyler Retzlaff wrote:
MSVC does not have a __builtin_constant_p intrinsic so provide
__rte_constant(e) that expands false for MSVC and to the intrinsic for
GCC.

Signed-off-by: Tyler Retzlaff <roret...@linux.microsoft.com>
---
  lib/eal/include/rte_common.h | 6 ++++++
  1 file changed, 6 insertions(+)

diff --git a/lib/eal/include/rte_common.h b/lib/eal/include/rte_common.h
index 298a5c6..d520be6 100644
--- a/lib/eal/include/rte_common.h
+++ b/lib/eal/include/rte_common.h
@@ -44,6 +44,12 @@
  #endif
  #endif
+#ifdef RTE_TOOLCHAIN_MSVC
+#define __rte_constant(e) 0
+#else
+#define __rte_constant(e) __extension__(__builtin_constant_p(e))
+#endif
+

Acked-by: Bruce Richardson <bruce.richard...@intel.com>

Reviewed-by: Andrew Rybchenko <andrew.rybche...@oktetlabs.ru>

Reply via email to