On Wed, 2016-06-15, 06:12 +0000, Dominik Seichter wrote:
>Hi Mabri,

>Thanks for the updated patch. I also do not have a Windows build environment
>around at the moment, so same situation as for you.>But you are right, maybe 
>the original report can test.

>@Ярослав Громов: Can you please test if the patch by Matthew fixes your 
>problem?


Hi all who mainly/only read the archive of this mailing list,
hi Dominik (who AFAIK isn't in that group :-) ),

because the mailing-list archive software has badly parsed the post I'm replying
to (plaintext+HTML e-mail with text attachment), only the attachment is 
displayed,
I have converted it to text-only to be parsed correctly, and re-added the patch 
as
attachment, so it can be read in the archive, and the patch taken from the 
attachment.

@Dominik: Could you please contact SourceForge.net support about this archive 
bug
and avoid sending posts containing HTML to the list?

>Thanks and best regards,

> Dominik

Best regards, mabri


On Tue, Jun 14, 2016 at 10:16 PM, Matthew Brincke <mabr...@ymail.com> wrote:

On Tue, 2016-06-14, 19:30 +0000, Dominik Seichter wrote:
>>Hi Mabri,
>
>>I agree that it should be as simple as that. But it should only be done
>>on Windows systems and should not be done for Unix systems. Can you add
>>preprocessor defines for this and test on windows please?
>
>Hi Dominik,
>
>I have added preprocessor defines to make this only take effect when
>building for Windows to the attached patch (otherwise the same), but I'm
>sorry, I can't test on Windows because I don't have a C++ compiler there
>(at least yet). What do you think about testing by the original reporter
>and by yourself?
>
>
>>Thanks,
>
>> Dominik
>
>Best regards, mabri
>
>
>
>On Tue, Jun 14, 2016 at 6:30 PM, Matthew Brincke <mabr...@ymail.com> wrote:
>
>Hi all,
>>
>>IMHO the fix for this should be minimally invasive, like in
>>the patch I've attached. I discovered I only needed to define
>>NOCRYPT before PdfDefinesPrivate.h is included in PdfEncrypt.cpp,
>>which is the only place where OpenSSL headers are included.
>>I wrote it so that no other include is, even potentially,
>>influenced by this. (Standard C and C++ headers don't include
>>windows.h AFAIK.) Please test this yourself as I can't permanently
>>install MinGW-w64 right now (I'd download it for today only,
>>I'm going to reinstall, IMHO that'd be waste of bandwidth).
>>
>>Please review/test, and if you're a committer and the test went
>>to your liking, please commit to the public repository.
>>
>>Best regards, mabri
>>
>>
>>
>>----- Original Message -----
>>From: zyx <z...@litepdf.cz>
>>To: podofo-users@lists.sourceforge.net
>>Sent: Tuesday, 14 June 2016, 12:26 UTC
>>Subject: Re: [Podofo-users] Building error PoDoFo
>>
>>On Sat, 2016-06-11 at 22:57 +0300, Ярослав Громов wrote:
>>> [  6%] Building CXX object
>>> src/CMakeFiles/podofo_shared.dir/base/PdfEncrypt.cpp.
>>> obj
>>> In file included from 
>>> D:/MGW64/mingw64/x86_64-w64-mingw32/include/windows.h:95:0
>>> ,
>>>                  from 
>>> D:/MGW64/mingw64/x86_64-w64-mingw32/include/winsock2.h:23,
>>>
>>>                  from 
>>> D:\MGW32\podofo32\src\base\PdfCompilerCompatPrivate.h:35,
>>>                  from D:\MGW32\podofo32\src\base\PdfDefinesPrivate.h:9,
>>>                  from D:\MGW32\podofo32\src\base\PdfEncrypt.cpp:30:
>>> D:/MGW32/GnuWin32/include/openssl/ossl_typ.h:176:33: error: expected ')' 
>>> before
>>> numeric constant
>>>  typedef struct ocsp_response_st OCSP_RESPONSE;
>>>                                                   ^
>>
>>    Hi,
>>there is a symbol clash between the wincrypt.h and openssl/ossl_typ.h,
>>both are defining OCSP_RESPONSE. The wincrypt.h has it as a #define,
>>while the openssl as a structure type name.
>>
>>Try to define (globally) NOCRYPT, which will avoid inclusion of the
>>wincrypt.h from the windows.h. The 'globally' can be as a CFLAGS
>>option, like -DNOCRYPT, or any similar way.
>>
>>Weird it didn't strike earlier.
>>    Bye,
>>    zyx
>>
>>--
>>
>>http://www.litePDF.cz                                 i...@litepdf.cz
>>
Index: src/base/PdfEncrypt.cpp
===================================================================
--- src/base/PdfEncrypt.cpp	(revision 1767)
+++ src/base/PdfEncrypt.cpp	(working copy)
@@ -27,8 +27,22 @@
 
 #include "PdfDictionary.h"
 #include "PdfFilter.h"
-#include "PdfDefinesPrivate.h"
 
+#ifdef _WIN32
+#ifndef NOCRYPT
+#define PODOFO_NO_WINCRYPT // to be defined only when including OpenSSL headers
+#define NOCRYPT // where this is defined to stop windows.h including wincrypt.h
+#endif
+#endif
+
+#include "PdfDefinesPrivate.h" // includes windows.h when building for Win32/64
+
+#ifdef _WIN32
+#ifdef PODOFO_NO_WINCRYPT
+#undef NOCRYPT // avoid influencing anything else
+#endif
+#endif
+
 #include <stdlib.h>
 #include <string.h>
 #include <sstream>
------------------------------------------------------------------------------
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. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
_______________________________________________
Podofo-users mailing list
Podofo-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/podofo-users

Reply via email to