[Bug 16954] New: #defines of LONG_MAX, LONG_MIN and INT_MIN are wrong
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(a)winehq.org ReportedBy: lkcl(a)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 + + -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16954 Dan Kegel <dank(a)kegel.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |dank(a)kegel.com --- Comment #1 from Dan Kegel <dank(a)kegel.com> 2009-01-19 11:08:01 --- I can't quite see what's wrong with Wine's definitions. (Why would (long) be needed around an NNNL constant?) Can you provide a small C test program that fails to compile (or compiles wrong)? Thanks... -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16954 --- Comment #2 from Dmitry Timoshkov <dmitry(a)codeweavers.com> 2009-01-20 11:15:15 --- What exactly the problem is? If you are compiling with Wine's msvcrt headers then you shouldn't do that, use libc provided by your platform. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16954 --- Comment #3 from Luke Kenneth Casson Leighton <lkcl(a)lkcl.net> 2009-01-20 11:29:14 --- hi tim, sorry there's quite a bit of context missing, from other bugreports over the past few days. i'm compiling python 2.5.2 using msys running under wine. so as far as msys is concerned, there _is_ no libc: it's as if i was compiling under native win32. so ... er... actually, this bug should probably be under mingw32 not wine! ha ha :) -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16954 Dmitry Timoshkov <dmitry(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |RESOLVED Resolution| |INVALID --- Comment #4 from Dmitry Timoshkov <dmitry(a)codeweavers.com> 2009-01-20 11:33:35 --- Exactly, Wine headers has nothing to do here. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16954 Dmitry Timoshkov <dmitry(a)codeweavers.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Dmitry Timoshkov <dmitry(a)codeweavers.com> 2009-01-20 11:33:45 --- Closing. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=16954 --- Comment #6 from Dan Kegel <dank(a)kegel.com> 2009-01-20 12:13:33 --- But they might, if somebody was building with winegcc. A minimal test case showing the problem would be enough to reopen this bug. -- Configure bugmail: http://bugs.winehq.org/userprefs.cgi?tab=email Do not reply to this email, post in Bugzilla using the above URL to reply. ------- You are receiving this mail because: ------- You are watching all bug changes.
participants (1)
-
wine-bugs@winehq.org