c923519
--- a/source/fitz/load-jpx.c                                                                                                                                                                                        
c923519
+++ b/source/fitz/load-jpx.c
c923519
@@ -484,13 +484,18 @@
c923519
 /* Without the definition of OPJ_STATIC, compilation fails on windows
c923519
  * due to the use of __stdcall. We believe it is required on some
c923519
  * linux toolchains too. */
c923519
+
c923519
+#ifdef __cplusplus
c923519
+extern "C"
c923519
+{
c923519
 #define OPJ_STATIC
c923519
 #ifndef _MSC_VER
c923519
 #define OPJ_HAVE_STDINT_H
c923519
 #endif
c923519
+#endif
c923519
 
c923519
-#include <openjpeg.h>
c923519
-
c923519
+#include <openjpeg-2.1/openjpeg.h>
c923519
+    
c923519
 /* OpenJPEG does not provide a safe mechanism to intercept
c923519
  * allocations. In the latest version all allocations go
c923519
  * though opj_malloc etc, but no context is passed around.
c923519
@@ -972,3 +977,7 @@
c923519
 }
c923519
 
c923519
 #endif /* HAVE_LURATECH */
c923519
+
c923519
+#ifdef __cplusplus                                                                                                                                                                                                 
c923519
+}                                                                                                                                                                                                                  
c923519
+#endif