'int' is enough for 'length' to migrate code from x86 to x64
Daniel Murphy via Digitalmars-d
digitalmars-d at puremagic.com
Fri Nov 21 00:03:46 PST 2014
"FrankLike" wrote in message news:musbvhmuuhhvetovxqwb at forum.dlang.org...
> If you compile the dfl Library to 64 bit,you will find error:
>
> core.sys.windows.windows.WaitForMultipleObjects(uint
> nCount,void** lpHandles,....) is not callable using argument
> types(ulong,void**,...)
>
> the 'WaitForMultipleObjects' Function is in
> dmd2/src/druntime/src/core/sys/windows/windows.d
>
> the argument of first is dfl's value ,it comes from a 'length'
> ,it's type is size_t,now it is 'ulong' on 64 bit.
>
> So druntime must keep the same as phobos for size_t.
> Or keep the same to int with WindowsAPI to modify the size_t to int ?
I suggest using WaitForMultipleObjects(to!uint(xxx.length), ...) as it will
both convert and check for overflow IIRC. I'm just happy D gives you an
error here instead of silently truncating the value.
More information about the Digitalmars-d
mailing list