aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Brunner <tobias@strongswan.org>2007-10-02 12:04:03 +0000
committerTobias Brunner <tobias@strongswan.org>2007-10-02 12:04:03 +0000
commit0572d414596ac8138d1327309ff336a64581d021 (patch)
treeb5f00362b9a9d83338a30b7aca390039d444e610
parente4c9b9217189ee27692460acd2d654f74ccd0cae (diff)
downloadstrongswan-0572d414596ac8138d1327309ff336a64581d021.tar.bz2
strongswan-0572d414596ac8138d1327309ff336a64581d021.tar.xz
destruction helper macros
-rw-r--r--src/libstrongswan/library.h12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/libstrongswan/library.h b/src/libstrongswan/library.h
index 74899a8c1..b091f2601 100644
--- a/src/libstrongswan/library.h
+++ b/src/libstrongswan/library.h
@@ -144,11 +144,21 @@
#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
*/
#define POS printf("%s, line %d\n", __FILE__, __LINE__)