diff options
author | Mattias Andrée <maandree@kth.se> | 2023-01-08 23:04:40 +0100 |
---|---|---|
committer | Mattias Andrée <maandree@kth.se> | 2023-01-08 23:04:40 +0100 |
commit | 930a75074eff7f1d3c91b3a244d47066247d7cd5 (patch) | |
tree | 177183a157223ba6d089822d3c7ee0b75e59dbab /common.h | |
parent | m + add tests (diff) | |
download | libfonts-930a75074eff7f1d3c91b3a244d47066247d7cd5.tar.gz libfonts-930a75074eff7f1d3c91b3a244d47066247d7cd5.tar.bz2 libfonts-930a75074eff7f1d3c91b3a244d47066247d7cd5.tar.xz |
Print warnings
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r-- | common.h | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -6,6 +6,7 @@ #include <inttypes.h> #include <limits.h> #include <pwd.h> +#include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -124,6 +125,18 @@ static inline void +warning(struct libfonts_context *ctx, int err, const char *function, const char *fmt, ...) +{ + va_list args; + if (ctx && ctx->warning) { + va_start(args, fmt); + ctx->warning(err, function, fmt, args, ctx->user); + va_end(args); + } +} + + +static inline void transform(double *x_out, double *y_out, double x, double y, const struct libfonts_transformation *transformation) { double a = transformation->m[0][0], b = transformation->m[0][1], c = transformation->m[0][2]; |