diff options
Diffstat (limited to 'src/libstrongswan/utils.h')
-rw-r--r-- | src/libstrongswan/utils.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libstrongswan/utils.h b/src/libstrongswan/utils.h index 8b1a8aaba..2669be61a 100644 --- a/src/libstrongswan/utils.h +++ b/src/libstrongswan/utils.h @@ -90,6 +90,11 @@ #define malloc_thing(thing) ((thing*)malloc(sizeof(thing))) /** + * Get the number of elements in an array + */ +#define countof(array) (sizeof(array)/sizeof(array[0])) + +/** * Assign a function as a class method */ #define ASSIGN(method, function) (method = (typeof(method))function) |