aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--common.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/common.h b/common.h
index dc9bcbd..787ec68 100644
--- a/common.h
+++ b/common.h
@@ -19,6 +19,9 @@
#define LEN(ARR) (sizeof(ARR) / sizeof(*(ARR)))
+#define FLEXSTRUCTSIZE(STRUCT, FLEXARRAY, FLEXARRAY_LENGTH)\
+ (offsetof(STRUCT, FLEXARRAY) + (FLEXARRAY_LENGTH) * sizeof(*((STRUCT *)NULL)->FLEXARRAY))
+
struct libskrift_font {
SFT_Font *font;
void *memory_free;