From: H.G. Muller Date: Tue, 2 Feb 2010 18:08:42 +0000 (+0100) Subject: Fix u64 format for cygwin X-Git-Tag: master-20100206~11 X-Git-Url: http://winboard.nl/cgi-bin?p=xboard.git;a=commitdiff_plain;h=5033c2869efc97a90075c0d72cc574859a70f854 Fix u64 format for cygwin 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 a switch USE_I64, which is defined only in the gcc makefile when MINGW is used. --- diff --git a/backend.h b/backend.h index effe385..a07e423 100644 --- a/backend.h +++ b/backend.h @@ -70,11 +70,17 @@ #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 USE_I64 + #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 diff --git a/winboard/makefile.gcc b/winboard/makefile.gcc index 49bcede..db65a67 100644 --- a/winboard/makefile.gcc +++ b/winboard/makefile.gcc @@ -28,7 +28,7 @@ USE_MINGW=1 # set up for cygwin or not ifeq ($(USE_MINGW),1) -CFCYG = -mno-cygwin +CFCYG = -mno-cygwin -DUSE_I64 LFCYG = -mno-cygwin -lmsvcrt endif