On Thu, 2016-05-12 at 11:51 +0200, Ulrich Arnold wrote:
> I'm not using CMake but a handbuild podofo_config.h and a
> VS2008-Solution-File to build. I have solved the problem in
> podofo_config.h
> by defining
> 
> #define _WINSOCKAPI_   /* Prevent inclusion of winsock.h in windows.h
> */
> 
> after the define of
> 
> #define PODOFO_HAVE_WINSOCK2_H 1

        Hi,
usual practice (or at least how I used to do it) was to include
winsock2.h before windows.h. It's better than rely on a private define
_WINSOCKAPI_.

Could you try with the attached patch, please?

As you noted above, the patch changes PdfImage.h only, because the
PdfImage.cpp is covered by the base/PdfDefinesPrivate.h, which includes
the winsock2.h when needed, but cannot be used in the (public) header
files.

        Thanks and bye,
        zyx

-- 
http://www.litePDF.cz                                 i...@litepdf.cz
Index: src/doc/PdfImage.h
===================================================================
--- src/doc/PdfImage.h	(revision 1722)
+++ src/doc/PdfImage.h	(working copy)
@@ -39,6 +39,12 @@
 #include "PdfXObject.h"
 
 #ifdef PODOFO_HAVE_TIFF_LIB
+#ifdef PODOFO_HAVE_WINSOCK2_H
+// In case the tiffio.h below includes windows.h on Windows,
+// to not mix winsock2.h with winsock.h.
+#include <winsock2.h>
+#endif // PODOFO_HAVE_WINSOCK2_H
+
 #  include "tiffio.h"
 #endif // PODOFO_HAVE_TIFF_LIB
 
------------------------------------------------------------------------------
Mobile security can be enabling, not merely restricting. Employees who
bring their own devices (BYOD) to work are irked by the imposition of MDM
restrictions. Mobile Device Manager Plus allows you to control only the
apps on BYO-devices by containerizing them, leaving personal data untouched!
https://ad.doubleclick.net/ddm/clk/304595813;131938128;j
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to