[xmlsec] Include file order

Peter Budai peterbudai at hotmail.com
Fri Jun 8 02:44:18 PDT 2018

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?

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.aleksey.com/pipermail/xmlsec/attachments/20180608/87319b6a/attachment.html>

More information about the xmlsec mailing list