Compilation errors with MingGW
Brought to you by:
xtmouse
C:\temp>gcc --version
gcc (GCC) 3.4.2 (mingw-special)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying
conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.
C:\temp>gcc.exe -c disphelper.c -o disphelper.o
-I"C:/MinGW/include"
disphelper.c:791: warning: integer constant is too
large for "long" type
disphelper.c:793: warning: integer constant is too
large for "long" type
disphelper.c:795: warning: integer constant is too
large for "long" type
Logged In: YES
user_id=1560131
Originator: NO
To fix these warnings, postfix your large constant values with 'ULL', like the following example
static const ULONGLONG LARGEVALUE_A = 864000000000; /* triggers warning */
static const ULONGLONG LARGEVALUE_B = 864000000000ULL; /* correct */
making the modifications with:
1) addition of postfix the ULL
2) #define _GLIBCPP_USE_WCHAR_T 1
is not successful to compile with Code:: Blocks ver.8.02 and with DevCpp 5
Help me
For whom it might interest:
Back in 2009 when we used xtmouse's DispHelper, we needed the following extra modifications:
swprintf
for the Microsoft-only_snwprint
%ls
) inswprintf
V_VT(pvResult)
instead ofpvResult->vt
With these fixes, not only were we able to use it with GCC compiler under windows (like MinGW32) but even get it working on Linux with wine-gcc
My patched version is available under this github fork:
https://github.com/DrYak/disphelper