From f62363d4e4a918b721b067f050e0125329d36330 Mon Sep 17 00:00:00 2001 From: CPunch Date: Wed, 18 May 2022 14:12:20 -0500 Subject: [PATCH] Lib: MAX & MIN are now inlined functions --- lib/include/laika.h | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/include/laika.h b/lib/include/laika.h index 9c0ee73..39f04a4 100644 --- a/lib/include/laika.h +++ b/lib/include/laika.h @@ -22,15 +22,13 @@ # define LAIKA_FORCEINLINE __forceinline #endif -#define MIN(a, b) \ - ({ __typeof__ (a) _a = (a); \ - __typeof__ (b) _b = (b); \ - _a < _b ? _a : _b; }) +LAIKA_FORCEINLINE int MIN(int a, int b) { + return a < b ? a : b; +} -#define MAX(a, b) \ - ({ __typeof__ (a) _a = (a); \ - __typeof__ (b) _b = (b); \ - _a > _b ? _a : _b; }) +LAIKA_FORCEINLINE int MAX(int a, int b) { + return a > b ? a : b; +} struct sLaika_peer; struct sLaika_socket;