destruction helper macros

This commit is contained in:
Tobias Brunner
2007-10-02 12:04:03 +00:00
parent e4c9b92171
commit 0572d41459
+11 -1
View File
@@ -144,10 +144,20 @@
#define min(x,y) ((x) < (y) ? (x):(y))
/**
* Call destructor of a object if object != NULL
* Call destructor of an object, if object != NULL
*/
#define DESTROY_IF(obj) if (obj) obj->destroy(obj)
/**
* Call offset destructor of an object, if object != NULL
*/
#define DESTROY_OFFSET_IF(obj, offset) if (obj) obj->destroy_offset(obj, offset);
/**
* Call function destructor of an object, if object != NULL
*/
#define DESTROY_FUNCTION_IF(obj, fn) if (obj) obj->destroy_function(obj, fn);
/**
* Debug macro to follow control flow
*/