diff options
Diffstat (limited to 'mmm.h')
-rw-r--r-- | mmm.h | 4 |
1 files changed, 4 insertions, 0 deletions
@@ -18,6 +18,7 @@ #define FREE(PTR) free(PTR); #define CALLOC(NMEMB,SIZE) calloc(NMEMB, SIZE); #define REALLOC(PTR,SIZE) realloc(PTR,SIZE); +#define IF_NULL(PTR,SUCCESS_CODE,FAILED_CODE) if ((PTR)==NULL){FAILED_CODE} else {SUCCESS_CODE}; #endif @@ -28,6 +29,7 @@ #define FREE(PTR) if (PTR!=NULL){free(PTR);PTR=NULL;}; #define CALLOC(NMEMB,SIZE) calloc(NMEMB, SIZE); #define REALLOC(PTR,SIZE) realloc(PTR,SIZE); +#define IF_NULL(PTR,SUCCESS_CODE,FAILED_CODE) if ((PTR)==NULL){FAILED_CODE} else {SUCCESS_CODE}; #endif @@ -38,6 +40,8 @@ #define FREE(PTR) mmm_free((PTR),__FILE__,__LINE__); #define CALLOC(NMEMB,SIZE) calloc(NMEMB,SIZE); #define REALLOC(PTR,SIZE) realloc(PTR,SIZE); +#define IF_NULL(PTR,SUCCESS_CODE,FAILED_CODE) if ((PTR)==NULL){FAILED_CODE} else {SUCCESS_CODE}; + void* mmm_malloc(size_t, const char *, int ); void mmm_free( void *, const char *, int ); |