diff --git a/gcml.h b/gcml.h index dbf9ec6..3d10af8 100644 --- a/gcml.h +++ b/gcml.h @@ -426,6 +426,29 @@ + +#define MAX_OF(...) MAX_OF_IMPL(__VA_ARGS__, MAX_OF_RSEQ_N()) +#define MAX_OF_IMPL(...) MAX_OF_ARG_N(__VA_ARGS__) +#define MAX_OF_ARG_N(_1, _2, _3, _4, _5, N, ...) N +#define MAX_OF_RSEQ_N() 5,4,3,2,1,0 + +#define MIN_OF(...) MIN_OF_IMPL(__VA_ARGS__, MIN_OF_RSEQ_N()) +#define MIN_OF_IMPL(...) MIN_OF_ARG_N(__VA_ARGS__) +#define MIN_OF_ARG_N(_1, _2, _3, _4, _5, N, ...) N +#define MIN_OF_RSEQ_N() 5,4,3,2,1,0 + + +#define ZERO_STRUCT(s) memset(&(s), 0, sizeof(s)) + + +#define PRINT_VAR(var) LOG_INFO(#var " = %d", var) + + + + + + + #endif // GCML_H