diff options
-rw-r--r-- | fitz/base_error.c | 2 | ||||
-rw-r--r-- | fitz/fitz.h | 11 |
2 files changed, 11 insertions, 2 deletions
diff --git a/fitz/base_error.c b/fitz/base_error.c index de41c023..c3c14a1d 100644 --- a/fitz/base_error.c +++ b/fitz/base_error.c @@ -72,6 +72,8 @@ void fz_warn(fz_context *ctx, const char *fmt, ...) * catch region entered with code = 1. */ +static void throw(fz_error_context *ex) FZ_NORETURN; + static void throw(fz_error_context *ex) { if (ex->top >= 0) { diff --git a/fitz/fitz.h b/fitz/fitz.h index f915d308..294ab958 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -113,6 +113,13 @@ FILE *fopen_utf8(const char *name, const char *mode); #define restrict #endif +/* noreturn is a GCC extension */ +#ifdef __GNUC__ +#define FZ_NORETURN __attribute__((noreturn)) +#else +#define FZ_NORETURN +#endif + /* GCC can do type checking of printf strings */ @@ -265,8 +272,8 @@ void fz_var_imp(void *); if (ctx->error->stack[ctx->error->top--].code > 1) int fz_push_try(fz_error_context *ex); -void fz_throw(fz_context *, const char *, ...) __printflike(2, 3); -void fz_rethrow(fz_context *); +void fz_throw(fz_context *, const char *, ...) __printflike(2, 3) FZ_NORETURN; +void fz_rethrow(fz_context *) FZ_NORETURN; void fz_warn(fz_context *ctx, const char *fmt, ...) __printflike(2, 3); const char *fz_caught(fz_context *ctx); |