[xmlsec] Include file order

Aleksey Sanin aleksey at aleksey.com
Fri Jun 8 09:44:29 PDT 2018


Interesting. Looks like libxslt is now including some windows crypto
code that triggered this issue.

I think changing includes order should be fine. Nothing in xmlsec
should depend on includes order. Do you mind sending a PR?

Aleksey

On 6/8/18 2:44 AM, Peter Budai wrote:
>  
> 
> With the latest release I have noticed that the build under MSYS2/MINGW
> is failing with the following message:
> 
> ../../../src/openssl/x509.c:109:66: error: expected declaration
> specifiers or '...' before '(' token
> 
> static xmlChar* xmlSecOpenSSLX509NameWrite (X509_NAME* nm);
> 
> ^
> 
> ../../../src/openssl/x509.c: In function
> 'xmlSecOpenSSLX509SubjectNameNodeWrite':
> 
>  
> 
> More detailed build log you can see here:
> https://ci.appveyor.com/project/peterbud/xmlsec/build/job/sc82e41xseg7c391#L494
> 
>  
> 
> The problem in my understanding is that Windows headers also #define
> some names that openssl uses too. Openssl headers #undef the offending
> names before reusing them. But if those offending Windows headers get
> included _/after/_ the openssl headers the namespace gets polluted.
> 
>  
> 
> As a solution I have changed the include order in the openssl/x509.c and
> openssl/x50vfy.c files, aka moved the openssl includes as the last files
> to include, and that solved the problem, I was able to compile and
> execute all the tests.
> 
>  
> 
> However I’m not sue this is the right solution. Any opinion?
> 
>  
> 
> Peter
> 
> 
> 
> _______________________________________________
> xmlsec mailing list
> xmlsec at aleksey.com
> http://www.aleksey.com/mailman/listinfo/xmlsec
> 


More information about the xmlsec mailing list