On Wed, Feb 25, 2009 at 2:25 PM, Iain Lewis <ile...@uk.ibm.com> wrote: > Matt Wilmas wrote: > >> >> (I'm glad this change was reverted for 5.2...) >> >> Anyway, like I said in my "5.3 todos" reply, I'll send a possible >> DVAL_TO_LVAL, etc. solution (consistent/reliable overflow across >> platforms) >> for consideration as soon as I can... There are other inconsistencies and >> behavior changes with the existing code, and it definitely doesn't behave >> in >> a platform-independent way! With the 4 versions of DVAL_...: old, 32 bit, >> 64 bit, 64 bit Windows (not sure why it's there; its longs are still 32 >> bit?), things I can think of: >> >> - Matt >> > > Longs are still 32bit on 64bit windows, which explains the special case for > windows.
That's correct. long is always 32bit on windows. See: http://msdn.microsoft.com/en-us/library/s3f49ktz.aspx and http://msdn.microsoft.com/en-us/library/cc953fe1.aspx > I'd be interested to see your possible solution to this. Having consistent > behaviour across platorms/32bit/64bit would be great from my p.o.v, as > writing tests for the current behaviour isn't fun at all! Something on our TODO is to use fixed and portable size types like what we can find in stdint. I have put a windows version in win32/php_stdint.h if you are interested. Ideally we should do that for all platforms and make them available for all parts of php (extensions, engine or main). Cheers, -- Pierre http://blog.thepimp.net | http://www.libgd.org -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php