Include file order
Peter Budai <[email protected]> Fri, 8 Jun 2018 09:44:18 +0000
| Newsgroups | gmane.text.xml.xmlsec |
|---|---|
| Message-ID | <AM5P189MB02918D480F47DC8DD497CFE3C27B0@AM5P189MB0291.EURP189.PROD.OUTLOOK.COM> |
--===============1162798813==
Content-Language: en-US
Content-Type: multipart/alternative;
boundary="_000_AM5P189MB02918D480F47DC8DD497CFE3C27B0AM5P189MB0291EURP_"
--_000_AM5P189MB02918D480F47DC8DD497CFE3C27B0AM5P189MB0291EURP_
Content-Type: text/plain; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
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 'xmlSecOpenSSLX509SubjectNameNodeW=
rite':
More detailed build log you can see here: https://ci.appveyor.com/project/p=
eterbud/xmlsec/build/job/sc82e41xseg7c391#L494
The problem in my understanding is that Windows headers also #define some n=
ames that openssl uses too. Openssl headers #undef the offending names befo=
re 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 op=
enssl/x50vfy.c files, aka moved the openssl includes as the last files to i=
nclude, and that solved the problem, I was able to compile and execute all =
the tests.
However I=92m not sue this is the right solution. Any opinion?
Peter
--_000_AM5P189MB02918D480F47DC8DD497CFE3C27B0AM5P189MB0291EURP_
Content-Type: text/html; charset="Windows-1252"
Content-Transfer-Encoding: quoted-printable
<html xmlns:o=3D"urn:schemas-microsoft-com:office:office" xmlns:w=3D"urn:sc=
hemas-microsoft-com:office:word" xmlns:m=3D"http://schemas.microsoft.com/of=
fice/2004/12/omml" xmlns=3D"http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv=3D"Content-Type" content=3D"text/html; charset=3DWindows-1=
252">
<meta name=3D"Generator" content=3D"Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
{font-family:"Cambria Math";
panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:11.0pt;
font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
{mso-style-priority:99;
color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-priority:99;
color:#954F72;
text-decoration:underline;}
.MsoChpDefault
{mso-style-type:export-only;}
@page WordSection1
{size:8.5in 11.0in;
margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
{page:WordSection1;}
--></style>
</head>
<body lang=3D"EN-US" link=3D"blue" vlink=3D"#954F72">
<div class=3D"WordSection1">
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">With the latest release I have noticed that the buil=
d under MSYS2/MINGW is failing with the following message:</p>
<p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">=
../../../src/openssl/x509.c:109:66: error: expected declaration specifiers =
or '...' before '(' token<o:p></o:p></span></p>
<div id=3D"L495">
<p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">=
static xmlChar* xmlSecOpenSSLX509NameWrite (X509_NAME* nm);<o:p></o:p></spa=
n></p>
</div>
<div id=3D"L496">
<p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">=
^<o:p></o:p></span></p>
</div>
<div id=3D"L497">
<p class=3D"MsoNormal"><span style=3D"font-family:"Courier New"">=
../../../src/openssl/x509.c: In function 'xmlSecOpenSSLX509SubjectNameNodeW=
rite':<o:p></o:p></span></p>
</div>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">More detailed build log you can see here: <a href=3D=
"https://ci.appveyor.com/project/peterbud/xmlsec/build/job/sc82e41xseg7c391=
#L494">
https://ci.appveyor.com/project/peterbud/xmlsec/build/job/sc82e41xseg7c391#=
L494</a></p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">The problem in my understanding is that Windows head=
ers also #define some names that openssl uses too. Openssl headers #undef t=
he offending names before reusing them. But if those offending Windows head=
ers get included _<i>after</i>_ the
openssl headers the namespace gets polluted.</p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">As a solution I have changed the include order in th=
e 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 c=
ompile and execute all the tests.</p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">However I=92m not sue this is the right solution. An=
y opinion?</p>
<p class=3D"MsoNormal"><o:p> </o:p></p>
<p class=3D"MsoNormal">Peter<o:p></o:p></p>
</div>
</body>
</html>
--_000_AM5P189MB02918D480F47DC8DD497CFE3C27B0AM5P189MB0291EURP_--
--===============1162798813==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KeG1sc2VjIG1h
aWxpbmcgbGlzdAp4bWxzZWNAYWxla3NleS5jb20KaHR0cDovL3d3dy5hbGVrc2V5LmNvbS9tYWls
bWFuL2xpc3RpbmZvL3htbHNlYwo=
--===============1162798813==--