[PATCH v6 1/1] net/intel: define __builtin_add_overflow for MSVC
Andre Muezerie
andremue at linux.microsoft.com
Thu Jun 5 16:47:25 CEST 2025
__builtin_add_overflow is gcc specific. A macro needs to be defined
for code using this to be compiled with MSVC.
Since only one driver is using this, this patch adds the macro to
that driver only. It can be moved to some common place if/when
needed.
Signed-off-by: Andre Muezerie <andremue at linux.microsoft.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
drivers/net/intel/ice/base/ice_osdep.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/drivers/net/intel/ice/base/ice_osdep.h b/drivers/net/intel/ice/base/ice_osdep.h
index ad6cde9896..4f635f00a4 100644
--- a/drivers/net/intel/ice/base/ice_osdep.h
+++ b/drivers/net/intel/ice/base/ice_osdep.h
@@ -128,6 +128,15 @@ 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(a, b, res) \
+ _Generic((a), \
+ uint8_t : _addcarry_u8, \
+ uint16_t : _addcarry_u16, \
+ uint32_t : _addcarry_u32, \
+ uint64_t : _addcarry_u64)(0, a, b, res)
+#endif
+
#endif /* __INTEL_NET_BASE_OSDEP__ */
#ifndef __always_unused
--
2.49.0.vfs.0.3
More information about the dev
mailing list