• Kenton Varda's avatar
    Work around strtod("nan") behavior on Windows. · a639c412
    Kenton Varda authored
    Windows -- including Cygwin -- return a NaN representation with the sign bit set, whereas other platforms return one without the sign bit set. This results in different binary output in the JSON-to-binary part of capnp-test.sh.
    
    This was uncovered since we're now runing capnp-test.sh for Cygwin builds, but the problem actually applies to *all* Windows builds. We just weren't running this test for the other builds before.
    
    Interestingly, I *had* run this test with a MinGW cross-compile build running on WINE, and it passed there. Seemingly, WINE's strtod() directly wraps the host system's without trying to emulate Windows differences.
    a639c412
string-test.c++ 9.93 KB