H.G.Muller wrote:Michel fixed it for me, by making the format dependent on a compiler switch. I think for Cygwin and Mingw it uses the %I64d.
I might have used an obsolete g++ on my desktop when making the original compile under Cygwin. It was the first time in my life I compiled a C++ program, I was surprised to learn thatI had the compiler installed.
But when I made a small test on my laptop printing a long long and a counting int behind it with the format "%lld %d" there was no problem at all. So perhaps the fix in the source would not have been needed. (It would have been needed for MVC, though.)
I have no idea which versions exactly I have installed, or even how I could see that.
For polyglot, the problem is twofold:
First, there were hardcoded "%lld" strings in the source instead of the proper S64_FORMAT defined in util.h
Second, S64_FORMAT has to be defined properly there as well. For polyglot, this meant adding _WIN32 in the check instead of just _MSC_VER. I'm pretty sure you need "%I64d" for anything linking with MSVCRT. That includes cygwin if you use the -mno_cygwin or whatever that switch is. Without that switch, you want "%lld" and that's what you'll get with cygwin because _WIN32 won't be defined.
Most toga sources I have found suffer from the latter problem. They properly use S64_FORMAT, but don't set it properly. That is why people have difficulty getting good toga builds using dev-cpp, but not with MS compilers.
Later versions of Visual Studio do not suffer from this issue, and work properly regardless if it is "%lld" or "%I64d", which is why some people don't see the problem. I presume because Visual Studio 2005 and later don't link with MSVCRT. The problem occurs in the vsprintf() and vprintf() routines in the MSVCRT runtime, I'm pretty sure.