Basically, don't use macros like this. You're just entering a world of pain.
Remember macros are a text expansion performed by the pre-processor. Let's pretend we're the pre-processor, with two of your macros...
#define MZERO(a, s) (a==NULL ? NULL : memset(a, 0, sizeof(a)*s))
#define CALLOC(t, s) s<=0 ? NULL : (t*)MZERO(calloc(sizeof(t), s), s)
Now, the part MZERO(calloc(sizeof(t), s), s)
will expand like this:-
(calloc(sizeof(t), s)==NULL ? NULL : memset(calloc(sizeof(t), s), 0, sizeof(calloc(sizeof(t), s))*s))
I think you didn't really want calloc
called three times. I can list a slew of other potential issues because you aren't correctly wrapping each param in brackets within the macros, but really, enough: Don't abuse macros like this.