summaryrefslogtreecommitdiff
path: root/include/mupdf/fitz
diff options
context:
space:
mode:
authorTor Andersson <tor.andersson@artifex.com>2018-02-12 12:28:18 +0100
committerTor Andersson <tor.andersson@artifex.com>2018-02-12 15:24:11 +0100
commite09f69509f160a22c9290fac054b790b0a80a0cc (patch)
treede8a91b6e1acb1fd007611bf032dc42cbdc10939 /include/mupdf/fitz
parentd84a2578417f812b6706e6274afecf05a3b34be2 (diff)
downloadmupdf-e09f69509f160a22c9290fac054b790b0a80a0cc.tar.xz
Don't pollute global namespace with __printflike.
Use a FZ_PRINTFLIKE macro instead.
Diffstat (limited to 'include/mupdf/fitz')
-rw-r--r--include/mupdf/fitz/context.h4
-rw-r--r--include/mupdf/fitz/system.h9
2 files changed, 7 insertions, 6 deletions
diff --git a/include/mupdf/fitz/context.h b/include/mupdf/fitz/context.h
index caa22977..5a05f940 100644
--- a/include/mupdf/fitz/context.h
+++ b/include/mupdf/fitz/context.h
@@ -78,10 +78,10 @@ void fz_var_imp(void *);
int fz_push_try(fz_context *ctx);
FZ_NORETURN void fz_vthrow(fz_context *ctx, int errcode, const char *, va_list ap);
-FZ_NORETURN void fz_throw(fz_context *ctx, int errcode, const char *, ...) __printflike(3, 4);
+FZ_NORETURN void fz_throw(fz_context *ctx, int errcode, const char *, ...) FZ_PRINTFLIKE(3,4);
FZ_NORETURN void fz_rethrow(fz_context *ctx);
void fz_vwarn(fz_context *ctx, const char *fmt, va_list ap);
-void fz_warn(fz_context *ctx, const char *fmt, ...) __printflike(2, 3);
+void fz_warn(fz_context *ctx, const char *fmt, ...) FZ_PRINTFLIKE(2,3);
const char *fz_caught_message(fz_context *ctx);
int fz_caught(fz_context *ctx);
void fz_rethrow_if(fz_context *ctx, int errcode);
diff --git a/include/mupdf/fitz/system.h b/include/mupdf/fitz/system.h
index 18d75a5c..277ec286 100644
--- a/include/mupdf/fitz/system.h
+++ b/include/mupdf/fitz/system.h
@@ -182,12 +182,13 @@ void fz_free_argv(int argc, char **argv);
#endif
/* GCC can do type checking of printf strings */
-#ifndef __printflike
+#ifdef __printflike
+#define FZ_PRINTFLIKE(F,V) __printflike(F,V)
+#else
#if __GNUC__ > 2 || __GNUC__ == 2 && __GNUC_MINOR__ >= 7
-#define __printflike(fmtarg, firstvararg) \
- __attribute__((__format__ (__printf__, fmtarg, firstvararg)))
+#define FZ_PRINTFLIKE(F,V) __attribute__((__format__ (__printf__, F, V)))
#else
-#define __printflike(fmtarg, firstvararg)
+#define FZ_PRINTFLIKE(F,V)
#endif
#endif