aboutsummaryrefslogtreecommitdiffstats
path: root/common.h
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2021-08-05 17:30:53 +0200
committerMattias Andrée <maandree@kth.se>2021-08-05 17:30:53 +0200
commit210d6ad784d55362d24a22cd7e07725a794d46cd (patch)
treed4a0359da4cc1dad27266994954b608a1ab1ff51 /common.h
parentdemo: refuse to write image to terminal (diff)
downloadlibskrift-210d6ad784d55362d24a22cd7e07725a794d46cd.tar.gz
libskrift-210d6ad784d55362d24a22cd7e07725a794d46cd.tar.bz2
libskrift-210d6ad784d55362d24a22cd7e07725a794d46cd.tar.xz
minor fixes and cleanups, and update to use new version of libgrapheme and add text length parameter instead of using NUL-termination
Signed-off-by: Mattias Andrée <maandree@kth.se>
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;