[v5,2/3] net/intel: use portable version of __builtin_add_overflow
Checks
Commit Message
__builtin_add_overflow is gcc specific. It should be replaced with
a portable version that can also be used with other compilers.
Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
---
drivers/net/intel/ice/base/ice_osdep.h | 5 +++++
1 file changed, 5 insertions(+)
Comments
On Fri, Mar 14, 2025 at 07:33:39AM -0700, Andre Muezerie wrote:
> __builtin_add_overflow is gcc specific. It should be replaced with
> a portable version that can also be used with other compilers.
>
> Signed-off-by: Andre Muezerie <andremue@linux.microsoft.com>
> ---
Acked-by: Bruce Richardson <bruce.richardson@intel.com>
@@ -14,6 +14,7 @@
#include <stdbool.h>
#include <rte_common.h>
+#include <rte_math.h>
#include <rte_memcpy.h>
#include <rte_malloc.h>
#include <rte_memzone.h>
@@ -128,6 +129,10 @@ writeq(uint64_t value, volatile void *addr)
#define wr64(a, reg, value) writeq((value), (a)->hw_addr + (reg))
#define rd64(a, reg) readq((a)->hw_addr + (reg))
+#ifdef RTE_TOOLCHAIN_MSVC
+#define __builtin_add_overflow rte_add_overflow
+#endif
+
#endif /* __INTEL_NET_BASE_OSDEP__ */
#ifndef __always_unused