Skip to content

Commit

Permalink
PDF: add support for poppler 0.85.0dev
Browse files Browse the repository at this point in the history
  • Loading branch information
rouault committed Jan 12, 2020
1 parent ff478f5 commit 6e9e51e
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion gdal/frmts/pdf/pdfdataset.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2580,7 +2580,10 @@ static void PDFDatasetErrorFunctionCommon(const CPLString& osError)
CPLError(CE_Failure, CPLE_AppDefined, "%s", osError.c_str());
}

static void PDFDatasetErrorFunction(void* /* userData*/,
static void PDFDatasetErrorFunction(
#if !(POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 85)
void* /* userData*/,
#endif
ErrorCategory /* eErrCategory */,
Goffset nPos,
#if POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 71
Expand Down Expand Up @@ -4087,7 +4090,11 @@ PDFDataset *PDFDataset::Open( GDALOpenInfo * poOpenInfo )
GooString* poUserPwd = nullptr;

/* Set custom error handler for poppler errors */
#if POPPLER_MAJOR_VERSION >= 1 || POPPLER_MINOR_VERSION >= 85
setErrorCallback(PDFDatasetErrorFunction);
#else
setErrorCallback(PDFDatasetErrorFunction, nullptr);
#endif

{
CPLMutexHolderD(&hGlobalParamsMutex);
Expand Down

0 comments on commit 6e9e51e

Please sign in to comment.