[gnome-commander/gcmd-1-2-8] Add patch to compile with poppler 0.20.0, fixes #676303



commit 6ef74b3fecca413196b293e977341666a5efde6f
Author: Marek Kašík <mkasik redhat com>
Date:   Thu Oct 31 19:32:05 2013 +0100

    Add patch to compile with poppler 0.20.0, fixes #676303

 configure.in                       |    3 +++
 src/tags/gnome-cmd-tags-poppler.cc |    9 ++++++++-
 2 files changed, 11 insertions(+), 1 deletions(-)
---
diff --git a/configure.in b/configure.in
index 3964e18..134b52e 100644
--- a/configure.in
+++ b/configure.in
@@ -239,6 +239,9 @@ if test x$with_poppler != xno; then
     if pkg-config --max-version=0.11.2 poppler; then
         AC_DEFINE(POPPLER_HAS_GET_PDF_VERSION, 1, [Define to 1 if poppler has support for 
PDFDoc::getPDFVersion()])
     fi
+    if pkg-config --atleast-version=0.19.0 poppler; then
+        AC_DEFINE(POPPLER_HAS_SET_ERROR_CALLBACK, 1, [Define to 1 if poppler has support for 
setErrorCallback()])
+    fi
 fi
 if test "x$have_pdf" = "xyes"; then
    AC_DEFINE(HAVE_PDF, 1, [Define to 1 if you have PDF support])
diff --git a/src/tags/gnome-cmd-tags-poppler.cc b/src/tags/gnome-cmd-tags-poppler.cc
index 439f152..64141b3 100644
--- a/src/tags/gnome-cmd-tags-poppler.cc
+++ b/src/tags/gnome-cmd-tags-poppler.cc
@@ -40,8 +40,11 @@ using namespace std;
 #ifdef HAVE_PDF
 static regex_t rxDate;
 static gboolean rxDate_OK;
-
+#ifdef POPPLER_HAS_SET_ERROR_CALLBACK
+static void noErrorReporting(void *, ErrorCategory, int pos, char *msg)
+#else
 static void noErrorReporting(int pos, char *msg, va_list args)
+#endif
 {
 }
 #endif
@@ -52,8 +55,12 @@ void gcmd_tags_poppler_init()
 #ifdef HAVE_PDF
     rxDate_OK = regcomp (&rxDate, 
"^(D:)?([12][019][0-9][0-9]([01][0-9]([0-3][0-9]([012][0-9]([0-5][0-9]([0-5][0-9])?)?)?)?)?)", 
REG_EXTENDED)==0;
 
+#ifdef POPPLER_HAS_SET_ERROR_CALLBACK
+    setErrorCallback(noErrorReporting, NULL);
+#else
     setErrorFunction(noErrorReporting);
 #endif
+#endif
 }
 
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]