<html>
<head>
<base href="http://bugzilla.gdcproject.org/" />
</head>
<body><table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Bug ID</th>
<td><a class="bz_bug_link
bz_status_NEW "
title="NEW - Preprocessor madness with MinGW"
href="http://bugzilla.gdcproject.org/show_bug.cgi?id=130">130</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>Preprocessor madness with MinGW
</td>
</tr>
<tr>
<th>Product</th>
<td>GDC
</td>
</tr>
<tr>
<th>Version</th>
<td>4.9.x
</td>
</tr>
<tr>
<th>Hardware</th>
<td>All
</td>
</tr>
<tr>
<th>OS</th>
<td>MinGW
</td>
</tr>
<tr>
<th>Status</th>
<td>NEW
</td>
</tr>
<tr>
<th>Severity</th>
<td>normal
</td>
</tr>
<tr>
<th>Priority</th>
<td>Normal
</td>
</tr>
<tr>
<th>Component</th>
<td>gdc
</td>
</tr>
<tr>
<th>Assignee</th>
<td>ibuclaw@gdcproject.org
</td>
</tr>
<tr>
<th>Reporter</th>
<td>johannespfau@gmail.com
</td>
</tr></table>
<p>
<div>
<pre>I'm updating the binary builds to GCC 4.9 right now and found a weird new bug:
I had to update the mingw64 headers and they now
#define strtod __strtod
in stdlib.h (or maybe they always did and the problem didn't show for some
reason, I don't know).
As a result, our 'Port::strtod' is hijacked into 'Port::__strtod'. So far, no
real problem. But it seems d-port.cc does not include the stdlib.h header so
the define is not effective there. As a result I get this link error when
linking cc1d:
------------------
d/lexer.dmd.o: In function `ZN5Lexer6inrealEP5Token':
/home/build/tmp/i686-w64-mingw32/.build/src/gcc-4.9.0/gcc/d/dfrontend/lexer.c:2360:
undefined reference to `Port::__strtod(char const*, char**)'
collect2: error: ld returned 1 exit status
i686-gdcproject-mingw32-nm d/lexer.dmd.o | grep strto
U __ZN4Port6strtofEPKcPPc
U __ZN4Port7strtoldEPKcPPc
U __ZN4Port8__strtodEPKcPPc
i686-gdcproject-mingw32-nm d/d-port.glue.o | grep strto
00000404 T __ZN4Port6strtodEPKcPPc
0000038a T __ZN4Port6strtofEPKcPPc
0000047e T __ZN4Port7strtoldEPKcPPc
------------------
I propose adding
------------------
// MinGWs stdlib.h defines strtod to __strtod.
// Depending on whether this header is included our function name changes...
#ifdef strtod
#undef strtod
#endif
------------------
to dfrontend/port.h. What do you think Iain?</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are watching all bug changes.</li>
</ul>
</body>
</html>