Could we get a LP64 version identifier?
Frits van Bommel
fvbommel at REMwOVExCAPSs.nl
Mon Jan 26 04:33:59 PST 2009
Jacob Carlborg wrote:
> Frits van Bommel wrote:
>> Jacob Carlborg wrote:
>>> Could we get a LP64 version identifier? I know that you can use this
>>> code:
>>>
>>> "static if ((void*).sizeof > int.sizeof)"
>>
>> Shouldn't that be "static if ((void*).sizeof == long.sizeof)" or just
>> "static if ((void*).sizeof == 8)"?
>> (Note that in D long.sizeof is guaranteed to be 8)
>
> Yeah that would also work. In D both long and int have a fixed size,
> therefore should all three ways work.
Nitpicking now: There could be a platform with 5-7 byte pointers[1], or
> 8-byte pointers, so "> int.sizeof" != "== long.sizeof".
[1]: Hey, x86 technically has 6-byte pointers if you count segments as
part of the pointer (which would be mostly useless on currently popular
operating systems though).
More information about the Digitalmars-d
mailing list