72de391e0d76b4a71f9d4663af78dabbe08fdabd galt Sat Jan 4 23:00:06 2025 -0800 added another explanatory note about using 0 not NULL to ArraySize macro. diff --git src/inc/common.h src/inc/common.h index 48f7a85..266d935 100644 --- src/inc/common.h +++ src/inc/common.h @@ -190,31 +190,32 @@ _IF(0)(it was not 0, it was 0) Should be "it was 0" _IF(1)(it was 1, it was not 1) Should be "it was 1" _IF(123)(it was 123)(it was not 123) Should be "it was 123" // Could not get NULL to work as it gets replaced by ((void *)0) and then ## makes a invalid token created error. _IF(NULL)(it was not null,it was null) Should be "it was null" but does not work */ /* How big is this array? - * Parameter a must not be NULL. Use 0 instead, or just the array name. */ + * Parameter a must not be NULL. Use 0 instead, or just the array name. + * Do not use an expression for parameter a, it is not supported. */ #define ArraySize(a) (_IF(a)((sizeof(a) / sizeof((a)[0])),(size_t)0)) #define uglyf printf /* debugging printf */ #define uglyAbort errAbort /* debugging error abort. */ #define uglyOut stdout /* debugging fprintf target. */ size_t memCheckPoint(); /* Return the amount of memory allocated since last called. */ void *needMem(size_t size); /* Need mem calls abort if the memory allocation fails. The memory * is initialized to zero. */ void *needLargeMem(size_t size); /* This calls abort if the memory allocation fails. The memory is