Fix u64 format for cygwin
authorH.G. Muller <h.g.muller@hccnet.nl>
Tue, 2 Feb 2010 18:08:42 +0000 (19:08 +0100)
committerArun Persaud <arun@nubati.net>
Sat, 6 Feb 2010 05:21:49 +0000 (21:21 -0800)
With a -mno-cygwin compile %llu and %lld are definitely not understood
by scanf and printf, although they are by the compiler. In stead, %I64u
seems to work. Put it in under control of the switch __MINGW__ .

backend.h

index cddf34b..8d0eef1 100644 (file)
--- a/backend.h
+++ b/backend.h
        #else
                /* place holder
                 * or dummy types for other compiler
+                * [HGM] seems that -mno-cygwin comple needs %I64?
                 */
                #define u64 unsigned long long
                #define s64 signed long long
-               #define u64Display "%llu"
-               #define s64Display "%lld"
+               #ifdef __MINGW32__
+                  #define u64Display "%I64u"
+                  #define s64Display "%I64d"
+               #else
+                  #define u64Display "%llu"
+                  #define s64Display "%lld"
+               #endif
                #define u64Const(c) (c ## ULL)
                #define s64Const(c) (c ## LL)
        #endif