From ac9a82de4c0cfa67c0c32e814556aa83434a46c7 Mon Sep 17 00:00:00 2001 From: Jonathan Bradley Date: Thu, 10 Apr 2025 11:13:35 -0400 Subject: pkmacros: don't inline + bump version to 0.4.7 --- config.mk | 2 +- pkmacros.h | 42 +++++++++++++++++++++--------------------- 2 files changed, 22 insertions(+), 22 deletions(-) diff --git a/config.mk b/config.mk index 5b976a2..606611b 100644 --- a/config.mk +++ b/config.mk @@ -1,5 +1,5 @@ # pk.h version -VERSION = 0.4.6 +VERSION = 0.4.7 # paths PREFIX = /usr/local diff --git a/pkmacros.h b/pkmacros.h index 583f6bc..30144bd 100644 --- a/pkmacros.h +++ b/pkmacros.h @@ -82,78 +82,78 @@ TypeName operator^=(TypeName& a, const TypeName& b); \ TypeName operator~(TypeName& a); #define TypeSafeInt2_B(TypeName, TypeName_T) \ - inline TypeName operator+(const TypeName& a, const TypeName& b) { \ + TypeName operator+(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) + static_cast(b)); \ } \ - inline TypeName operator-(const TypeName& a, const TypeName& b) { \ + TypeName operator-(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) - static_cast(b)); \ } \ - inline TypeName operator*(const TypeName& a, const TypeName& b) { \ + TypeName operator*(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) * static_cast(b)); \ } \ - inline TypeName operator/(const TypeName& a, const TypeName& b) { \ + TypeName operator/(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) / static_cast(b)); \ } \ - inline TypeName operator&(const TypeName& a, const TypeName& b) { \ + TypeName operator&(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) & static_cast(b)); \ } \ - inline TypeName operator|(const TypeName& a, const TypeName& b) { \ + TypeName operator|(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) | static_cast(b)); \ } \ - inline TypeName operator^(const TypeName& a, const TypeName& b) { \ + TypeName operator^(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) ^ static_cast(b)); \ } \ - inline TypeName& operator++(TypeName& a) { \ + TypeName& operator++(TypeName& a) { \ a = a + TypeName{1}; \ return a; \ } \ - inline TypeName& operator--(TypeName& a) { \ + TypeName& operator--(TypeName& a) { \ a = a - TypeName{1}; \ return a; \ }; \ - inline TypeName operator++(TypeName& a, int) { \ + TypeName operator++(TypeName& a, int) { \ a = a + TypeName{1}; \ return a; \ } \ - inline TypeName operator--(TypeName& a, int) { \ + TypeName operator--(TypeName& a, int) { \ a = a - TypeName{1}; \ return a; \ }; \ - inline TypeName operator<<(const TypeName& a, const TypeName& b) { \ + TypeName operator<<(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) << static_cast(b)); \ }; \ - inline TypeName operator>>(const TypeName& a, const TypeName& b) { \ + TypeName operator>>(const TypeName& a, const TypeName& b) { \ return TypeName(static_cast(a) >> static_cast(b)); \ }; \ - inline TypeName operator+=(TypeName& a, const TypeName& b) { \ + TypeName operator+=(TypeName& a, const TypeName& b) { \ a = TypeName{a + b}; \ return a; \ }; \ - inline TypeName operator-=(TypeName& a, const TypeName& b) { \ + TypeName operator-=(TypeName& a, const TypeName& b) { \ a = TypeName{a - b}; \ return a; \ }; \ - inline TypeName operator*=(TypeName& a, const TypeName& b) { \ + TypeName operator*=(TypeName& a, const TypeName& b) { \ a = TypeName{a * b}; \ return a; \ }; \ - inline TypeName operator/=(TypeName& a, const TypeName& b) { \ + TypeName operator/=(TypeName& a, const TypeName& b) { \ a = TypeName{a / b}; \ return a; \ }; \ - inline TypeName operator&=(TypeName& a, const TypeName& b) { \ + TypeName operator&=(TypeName& a, const TypeName& b) { \ a = TypeName{a & b}; \ return a; \ }; \ - inline TypeName operator|=(TypeName& a, const TypeName& b) { \ + TypeName operator|=(TypeName& a, const TypeName& b) { \ a = TypeName{a | b}; \ return a; \ }; \ - inline TypeName operator^=(TypeName& a, const TypeName& b) { \ + TypeName operator^=(TypeName& a, const TypeName& b) { \ a = TypeName{a ^ b}; \ return a; \ }; \ - inline TypeName operator~(TypeName& a) { \ + TypeName operator~(TypeName& a) { \ a = static_cast(~static_cast(a)); \ return a; \ }; -- cgit v1.2.3