Lado, thank you for the LOCALE_XX defines!

I'm still working on getting Python 2.0 to compile using MinGW32 2.95.2-1, and I came across a compiler error I can't seem to get around. Can anybody tell me why the following doesn't work, even though the union casts match if they're traced back far enough?

// largeinteger.c

// Distillation of important parts from longint.h
#include <windows.h>
#define _toi (__int64)
// This line (the current implementation) does not:
#define LargeIntegerAdd(a,b) (LARGE_INTEGER)( _toi(a) + _toi(b) )
// This line works by adding an explicit cast to LONGLONG:
// #define LargeIntegerAdd(a,b) (LARGE_INTEGER)((LONGLONG)(_toi(a) + _toi(b)))
#undef _toi

void test(void)


C:\>gcc -c -save-temps largeinteger.c
largeinteger.c: In function `test':
largeinteger.c:16: cast to union type from type not present in union

I don't understand how the largeint.h functions ever worked (maybe they never did?), because gcc complains every time for me. The process to add LARGE_INTEGER unions involves casting them to __int64, which is LONGLONG, which is long long. So, it is eventually be traced back to implicit casts to 'long long' which are added together and recast to the LARGE_INTEGER union, which contains a LONGLONG variable type. Everything seems to match. Any ideas?


Ben Allfree