diff options
author | Robin Watts <robin.watts@artifex.com> | 2013-06-28 12:51:28 +0100 |
---|---|---|
committer | Robin Watts <robin.watts@artifex.com> | 2013-06-28 12:53:33 +0100 |
commit | c256490e6927539522e2433e3b300515f85a25bf (patch) | |
tree | 22ba904b93cea85b0df223cf4f7bd1a3e0111b00 | |
parent | 9df3a0615a1fa7745160c099e1ac7cd4dfcbc86e (diff) | |
download | mupdf-c256490e6927539522e2433e3b300515f85a25bf.tar.xz |
Modify FZ_NORETURN to work on MSVC too.
We need to have it as a prefix, not a postfix now, but it should
work on both gcc and MSVC now.
-rw-r--r-- | include/mupdf/fitz/context.h | 6 | ||||
-rw-r--r-- | include/mupdf/fitz/system.h | 4 | ||||
-rw-r--r-- | source/fitz/error.c | 2 |
3 files changed, 8 insertions, 4 deletions
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h index 5f5df366..d7365227 100644 --- a/include/mupdf/fitz/context.h +++ b/include/mupdf/fitz/context.h @@ -65,9 +65,9 @@ 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 *, int errcode, const char *, ...) __printflike(3, 4) FZ_NORETURN; -void fz_rethrow(fz_context *) FZ_NORETURN; -void fz_rethrow_message(fz_context *, const char *, ...) __printflike(2, 3) FZ_NORETURN; +FZ_NORETURN void fz_throw(fz_context *, int errcode, const char *, ...) __printflike(3, 4); +FZ_NORETURN void fz_rethrow(fz_context *); +FZ_NORETURN void fz_rethrow_message(fz_context *, const char *, ...) __printflike(2, 3); void fz_warn(fz_context *ctx, const char *fmt, ...) __printflike(2, 3); const char *fz_caught_message(fz_context *ctx); int fz_caught(fz_context *ctx); diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h index 53d400dc..e9f337b5 100644 --- a/include/mupdf/fitz/system.h +++ b/include/mupdf/fitz/system.h @@ -155,8 +155,12 @@ void fz_free_argv(int argc, char **argv); #ifdef __GNUC__ #define FZ_NORETURN __attribute__((noreturn)) #else +#ifdef _MSC_VER +#define FZ_NORETURN __declspec(noreturn) +#else #define FZ_NORETURN #endif +#endif /* GCC can do type checking of printf strings diff --git a/source/fitz/error.c b/source/fitz/error.c index 50b3c5aa..13ca9c23 100644 --- a/source/fitz/error.c +++ b/source/fitz/error.c @@ -72,7 +72,7 @@ void fz_warn(fz_context *ctx, const char *fmt, ...) * catch region entered with code = 1. */ -static void throw(fz_error_context *ex) FZ_NORETURN; +FZ_NORETURN static void throw(fz_error_context *ex); static void throw(fz_error_context *ex) { |