rcx

library of miscellaneous bits of C code
git clone git://git.rr3.xyz/rcx
Log | Files | Refs | README | LICENSE

commit 3b69b7439c4e37b50d60deae8cf9509ba31f664c
parent 1a385d197c815bec4049d60f6d20d74030126c31
Author: Robert Russell <robertrussell.72001@gmail.com>
Date:   Wed, 17 Jul 2024 17:37:27 -0700

Clean up array operations in def.h

Diffstat:
Minc/def.h | 3++-
1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/inc/def.h b/inc/def.h @@ -29,10 +29,11 @@ * XXX: Usage of this macro depends on nonstandard features. */ #define VA_DEFAULT(_, v, ...) v -#define LEN(a) (sizeof (a) / sizeof (a)[0]) #define MIN(a,b) ((a) < (b) ? (a) : (b)) #define MAX(a,b) ((a) > (b) ? (a) : (b)) +/* Polymorphic array operations */ +#define LEN(a) (sizeof (a) / sizeof (a)[0]) #define SET(a, v) do { memcpy(&(a), (v), sizeof(a)); } while (0) #define SWAP(a, b) do { \