diff options
-rw-r--r-- | android/jni/ThirdParty.mk | 2 | ||||
-rw-r--r-- | fitz/base_error.c | 6 | ||||
-rw-r--r-- | fitz/fitz.h | 10 |
3 files changed, 17 insertions, 1 deletions
diff --git a/android/jni/ThirdParty.mk b/android/jni/ThirdParty.mk index 2a50b05f..0ea140c3 100644 --- a/android/jni/ThirdParty.mk +++ b/android/jni/ThirdParty.mk @@ -94,7 +94,7 @@ LOCAL_SRC_FILES := \ $(MY_ROOT)/thirdparty/jpeg-8c/jquant2.c \ $(MY_ROOT)/thirdparty/jpeg-8c/jutils.c \ $(MY_ROOT)/thirdparty/jpeg-8c/jmemmgr.c \ - $(MY_ROOT)/thirdparty/jpeg-8c/jmemansi.c \ + $(MY_ROOT)/thirdparty/jpeg-8c/jmemnobs.c \ $(MY_ROOT)/thirdparty/zlib-1.2.5/adler32.c \ $(MY_ROOT)/thirdparty/zlib-1.2.5/compress.c \ $(MY_ROOT)/thirdparty/zlib-1.2.5/crc32.c \ diff --git a/fitz/base_error.c b/fitz/base_error.c index 1184981c..94876d96 100644 --- a/fitz/base_error.c +++ b/fitz/base_error.c @@ -10,7 +10,10 @@ void fz_var_imp(void *var) void fz_flush_warnings(fz_context *ctx) { if (ctx->warn->count > 1) + { fprintf(stderr, "warning: ... repeated %d times ...\n", ctx->warn->count); + LOGE("warning: %s\n", ctx->warn->count); + } ctx->warn->message[0] = 0; ctx->warn->count = 0; } @@ -32,6 +35,7 @@ void fz_warn(fz_context *ctx, char *fmt, ...) { fz_flush_warnings(ctx); fprintf(stderr, "warning: %s\n", buf); + LOGE("warning: %s\n", buf); fz_strlcpy(ctx->warn->message, buf, sizeof ctx->warn->message); ctx->warn->count = 1; } @@ -45,6 +49,7 @@ static void throw(fz_error_context *ex) longjmp(ex->stack[ex->top--].buffer, 1); } else { fprintf(stderr, "uncaught exception: %s\n", ex->message); + LOGE("uncaught exception: %s\n", ex->message); exit(EXIT_FAILURE); } } @@ -75,6 +80,7 @@ void fz_throw(fz_context *ctx, char *fmt, ...) va_end(args); fprintf(stderr, "error: %s\n", ctx->error->message); + LOGE("error: %s\n", ctx->error->message); throw(ctx->error); } diff --git a/fitz/fitz.h b/fitz/fitz.h index fe0e4d6b..a5695d56 100644 --- a/fitz/fitz.h +++ b/fitz/fitz.h @@ -22,6 +22,16 @@ #include "memento.h" +#ifdef __ANDROID__ +#include <android/log.h> +#define LOG_TAG "libmupdf" +#define LOGI(...) __android_log_print(ANDROID_LOG_INFO,LOG_TAG,__VA_ARGS__) +#define LOGE(...) __android_log_print(ANDROID_LOG_ERROR,LOG_TAG,__VA_ARGS__) +#else +#define LOGI(...) do {} while(0) +#define LOGE(...) do {} while(0) +#endif + #define nelem(x) (sizeof(x)/sizeof((x)[0])) #define ABS(x) ( (x) < 0 ? -(x) : (x) ) |