On 12-5-2014 21:32, Jon A. Cruz wrote:
 
 
 
On Mon, May 12, 2014, at 12:03 PM, liamw wrote:
Hi Johan, 
 
There was a thing in the building-inkspace file about strtod.
 
// double dbl = Glib::Ascii::strtod(srgb.substr(numPos + 3));
std::stringstream( srgb.substr(numPos + 3) ) >> dbl;
 
That's basically all you have to do, except redeclare dbl outside its scope.
 
 
 
That replacement is likely to cause problems. The standard iostream operations are localizable, so being local sensitive will make them produce different results or reject good data on different systems. For example, the strtod conversion normally runs into errors parsing things with a decimal separator as it is ',' on a large portion of systems but is '.' on a large portion of others.
 
Preventing such run-time errors is a key reason to use the Glib::Ascii:* routines.


I found the problem.
MinGW's stdlib.h is doing this:
#define strtod __strtod

Hence, you can no longer use strtod from another namespace; you'd get:
src/widgets/ege-paint-def.cpp:247:34: error: '__strtod' is not a member of 'Glib
::Ascii'
                     double dbl = Glib::Ascii::strtod(srgb.substr(numPos + 3));
                                  ^
(after reordering the include files, I got this error, which made me realize a macro is causing trouble)


Turns out we don't needto include <stdlib.h> in that particular file. (at least not for my builds). If we do need it, we should add
#undef ...
after including it.

Cheers,
  Johan