X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Fcommon%2Fmacros.h;h=308d3d57a14d5ff9ad7911383af9f40f0477c4da;hb=062fc3d82f245d6166457ebb0af9ea38abc30378;hp=f6f975d1453d7ffa89deb2e4e97f55afafee514c;hpb=99c815c136c28d8bd8cb270d3eb981901a28c6a6;p=lttng-tools.git diff --git a/src/common/macros.h b/src/common/macros.h index f6f975d14..308d3d57a 100644 --- a/src/common/macros.h +++ b/src/common/macros.h @@ -46,7 +46,11 @@ /* * Memory allocation zeroed */ -#define zmalloc(x) calloc(1, x) +static inline +void *zmalloc(size_t len) +{ + return calloc(1, len); +} #ifndef ARRAY_SIZE #define ARRAY_SIZE(array) (sizeof(array) / (sizeof((array)[0]))) @@ -56,6 +60,10 @@ #define max(a, b) ((a) > (b) ? (a) : (b)) #endif +#ifndef max_t +#define max_t(type, a, b) ((type) max(a, b)) +#endif + #ifndef min #define min(a, b) ((a) < (b) ? (a) : (b)) #endif