From 954153a4ec5faf19b087e903998519dc53ff3b44 Mon Sep 17 00:00:00 2001 From: Rosen Penev Date: Sun, 7 May 2023 00:03:15 -0700 Subject: [PATCH] replace inline with coonstexpr Signed-off-by: Rosen Penev --- src/safe_op.hpp | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/safe_op.hpp b/src/safe_op.hpp index 85453a99..ca87202a 100644 --- a/src/safe_op.hpp +++ b/src/safe_op.hpp @@ -110,12 +110,12 @@ bool builtin_add_overflow(T summand_1, T summand_2, T& result) { * The intrinsics are documented here: * https://gcc.gnu.org/onlinedocs/gcc/Integer-Overflow-Builtins.html#Integer-Overflow-Builtins */ -#define SPECIALIZE_builtin_add_overflow(type, builtin_name) \ - /* Full specialization of builtin_add_overflow for type using the */ \ - /* builtin_name intrinsic */ \ - template <> \ - inline bool builtin_add_overflow(type summand_1, type summand_2, type & result) { \ - return builtin_name(summand_1, summand_2, &result); \ +#define SPECIALIZE_builtin_add_overflow(type, builtin_name) \ + /* Full specialization of builtin_add_overflow for type using the */ \ + /* builtin_name intrinsic */ \ + template <> \ + constexpr bool builtin_add_overflow(type summand_1, type summand_2, type & result) { \ + return builtin_name(summand_1, summand_2, &result); \ } SPECIALIZE_builtin_add_overflow(int, __builtin_sadd_overflow);