bug-xboard
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Bug-XBoard] We distribute wrongly compiled WinBoard binaries


From: Eric Mullins
Subject: Re: [Bug-XBoard] We distribute wrongly compiled WinBoard binaries
Date: Wed, 03 Feb 2010 02:06:25 -0700
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

h.g. muller wrote:

That can be done. But if you do that, then in makefile.ms, you must always -DUSE_I64.

That case would already be covered because the _MSC_VER switch is set there, not? because then you would also need other basic type names and constant suffixes for
the long data types. So I was thinking about a structure like

#ifdef _WIN32
  #ifdef _MSC_VER
    //define MSCtypes
    #define u64Display "%I64u"
  #else
    //define standard C types
    #ifdef USE_I64
      #define u64Display "%I64u"
    #else
      #define u64Display "%llu"
    #endif
#else
    //define standard C types
    #define u64Display "%llu"
#endif

(where only the innermost #ifdef is new).


No. You do not want to check against _MSC_VER for the format specification. What matters is linking against the msvcrt, not the compiler used. You *could* check the _MSC_VER in order to prefer "%lld" when you know you'll be linking with non-buggy versions. But since they are back-compatible to support the %I64 syntax, it isn't necessary.

You DO want to check against _MSC_VER for the data type itself. When using MS compilers, it needs to be __int64 of some flavor, and long long for non-MS compilers. Linking with the msvcrt is irrelevant for the data type itself.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]