summaryrefslogtreecommitdiff
path: root/fitz
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2012-01-06 18:55:50 +0000
committerRobin Watts <robin.watts@artifex.com>2012-01-06 18:55:50 +0000
commit1ef1a581229dfc0b0466600bb8bc01b3109be02f (patch)
tree56e847973641a7c35d1b266da0599810e4e8182d /fitz
parentd6fab6582c26c133589c83134e76e7a29ff57962 (diff)
downloadmupdf-1ef1a581229dfc0b0466600bb8bc01b3109be02f.tar.xz
Android tweaks.
Include android headers in fitz.h so we can debug. Arrange for error throwing to output to android error stream as well as stderr. Change jpeg library to not use backing store. Solves bug 692473.
Diffstat (limited to 'fitz')
-rw-r--r--fitz/base_error.c6
-rw-r--r--fitz/fitz.h10
2 files changed, 16 insertions, 0 deletions
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) )