Hi all,
attached to this e-mail is a patch to fix the header
collision. I'm sorry, because I have a tight deadline
in studies (I need to do some scientific writing to be
eligible for the degree), so I couldn't test (except
with libturbojpeg, but there was no collision). With
libjpeg (from IJG, at least version 6b) there is one:
Please see this post of mine on November 11th, 2015:
[Podofo-users] workaround for typedef conflict between Win32 and libjpeg headers
(URL http://sourceforge.net/p/podofo/mailman/message/34609897/ in the archive)
AFAIK there weren't any changes which could mitigate this the meantime.
IMHO this is important enough for inclusion in the
upcoming release 0.9.4, I hope you (committers) share
this opinion and please test and then commit for me.
I would've felt bad without sharing this with you.
Thanks in advance.
Best regards, mabri
Index: src/base/PdfFiltersPrivate.h
===================================================================
--- src/base/PdfFiltersPrivate.h (revision 1761)
+++ src/base/PdfFiltersPrivate.h (working copy)
@@ -53,11 +53,21 @@
#ifdef PODOFO_HAVE_JPEG_LIB
extern "C" {
-#ifdef _WIN32 // Collision between win and jpeg-headers
+#ifdef _WIN32 // Collision between Win32 and libjpeg headers
#define XMD_H
#undef FAR
+
+#ifndef HAVE_BOOLEAN
+#define HAVE_BOOLEAN
+#define PODOFO_JPEG_HAVE_BOOLEAN // not to be defined in the build system
#endif
+
+#endif
#include "jpeglib.h"
+
+#ifdef PODOFO_JPEG_HAVE_BOOLEAN
+#undef HAVE_BOOLEAN
+#endif
}
#endif // PODOFO_HAVE_JPEG_LIB
Index: src/doc/PdfImage.cpp
===================================================================
--- src/doc/PdfImage.cpp (revision 1761)
+++ src/doc/PdfImage.cpp (working copy)
@@ -44,28 +44,9 @@
#include <wchar.h>
#include <sstream>
-#ifdef PODOFO_HAVE_TIFF_LIB
-extern "C" {
-# include "tiffio.h"
-# ifdef _WIN32 // Collision between tiff and jpeg-headers
-# ifndef XMD_H
-# define XMD_H
-# endif
-# undef FAR
-# endif
-}
-#endif // PODOFO_HAVE_TIFF_LIB
+// TIFF and JPEG headers already included through "base/PdfFiltersPrivate.h",
+// although in opposite order (first JPEG, then TIFF), if available of course
-#ifdef PODOFO_HAVE_JPEG_LIB
-extern "C" {
-# ifndef XMD_H
-# define XMD_H
-# endif
-# include "jpeglib.h"
-}
-
-#endif // PODOFO_HAVE_JPEG_LIB
-
#ifdef PODOFO_HAVE_PNG_LIB
#include <png.h>
#endif /// PODOFO_HAVE_PNG_LIB
Index: src/doc/PdfSigIncMemDocument.cpp
===================================================================
--- src/doc/PdfSigIncMemDocument.cpp (revision 1761)
+++ src/doc/PdfSigIncMemDocument.cpp (working copy)
@@ -62,10 +62,16 @@
# ifndef XMD_H
# define XMD_H
# endif
-# ifdef _WIN32 // Collision between win and jpeg-headers
+# ifdef _WIN32 // Collision between Win32 and libjpeg headers
# undef FAR
+# ifndef HAVE_BOOLEAN
+# define HAVE_BOOLEAN
+# define PODOFO_JPEG_HAVE_BOOLEAN // not to be defined in the build system
# endif
# include "jpeglib.h"
+# ifdef PODOFO_JPEG_HAVE_BOOLEAN
+# undef HAVE_BOOLEAN
+# endif
}
#endif // PODOFO_HAVE_JPEG_LIB
------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users