http://bugs.winehq.org/show_bug.cgi?id=16954
Summary: #defines of LONG_MAX, LONG_MIN and INT_MIN are wrong Product: Wine Version: unspecified Platform: Other OS/Version: other Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown AssignedTo: wine-bugs@winehq.org ReportedBy: lkcl@lkcl.net
a build of python2.5.2 under msys under wine goes completely tits-up due to very strange long / int interactions.
the addition of a (long) typecast (around 0xNNNNL!) fixes the problem.
the definitions in the standard wine / mingw32 header files are completely at odds with standard linux #defines for LONG_MAX and LONG_MIN.
the definition below for INT_MIN matches the standard linux #define, and has the advantage that it actually works.
+#ifdef __WINE__ /* weird: you have to typecast 0x7fffffffL to long */ +#undef LONG_MAX +#undef LONG_MIN +#define LONG_MAX ((long)0x7FFFFFFFL) +#define LONG_MIN ((long)(-LONG_MAX-1)) +#else
+#ifdef __WINE__ +/* wine's #define of INT_MIN slightly faulty... + */ +#undef INT_MIN +#define INT_MIN (-INT_MAX - 1) +#endif + +