summaryrefslogtreecommitdiff
path: root/mmm.h
diff options
context:
space:
mode:
Diffstat (limited to 'mmm.h')
-rw-r--r--mmm.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/mmm.h b/mmm.h
index 4b1c368..7232b52 100644
--- a/mmm.h
+++ b/mmm.h
@@ -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 );