I know that for a single lined macro, we would simply use
#ifndef X
#define X 10
#endif
However I am attempting to do the same thing but with a multi-lined macro
#ifndef mallocErr(X)
#define mallocErr(X) \
do { \
if (X == NULL) { \
perror("malloc"); \
exit(EXIT_FAILURE); \
} \
} while (0) \
#endif
I'm sure my issue is that the syntax for #ifndef mallocErr(X) is incorrect, but I can't seem to find the proper format, or maybe I am approaching this the wrong way?