Jump to page: 1 2 3
Thread overview
Could we get a LP64 version identifier?
Jan 25, 2009
Jacob Carlborg
Jan 25, 2009
Frits van Bommel
Jan 25, 2009
Jacob Carlborg
Jan 25, 2009
Jacob Carlborg
Jan 26, 2009
Frits van Bommel
Jan 26, 2009
Walter Bright
Jan 27, 2009
Frits van Bommel
Jan 27, 2009
Joel C. Salomon
Jan 27, 2009
Walter Bright
Jan 29, 2009
Peter C. Chapin
Feb 08, 2009
Walter Bright
Jan 25, 2009
Denis Koroskin
Jan 25, 2009
Jacob Carlborg
Jan 25, 2009
Denis Koroskin
Jan 25, 2009
Denis Koroskin
Jan 25, 2009
Jacob Carlborg
Jan 25, 2009
Walter Bright
Jan 26, 2009
Jacob Carlborg
Jan 26, 2009
Frits van Bommel
Jan 26, 2009
Walter Bright
Jan 27, 2009
Jacob Carlborg
Jan 27, 2009
Frits van Bommel
Jan 27, 2009
Jacob Carlborg
Jan 27, 2009
Daniel Keep
Jan 26, 2009
Walter Bright
January 25, 2009
Could we get a LP64 version identifier? I know that you can use this code:

"static if ((void*).sizeof > int.sizeof)"

to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.
January 25, 2009
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)

> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.
January 25, 2009
On Sun, 25 Jan 2009 15:32:33 +0300, Jacob Carlborg <doobnet@gmail.com> wrote:

> Could we get a LP64 version identifier? I know that you can use this code:
>
> "static if ((void*).sizeof > int.sizeof)"
>
> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.

version (X86) {
 ...
} else {
 ...
}

January 25, 2009
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.
January 25, 2009
Denis Koroskin wrote:
> On Sun, 25 Jan 2009 15:32:33 +0300, Jacob Carlborg <doobnet@gmail.com> wrote:
> 
>> Could we get a LP64 version identifier? I know that you can use this code:
>>
>> "static if ((void*).sizeof > int.sizeof)"
>>
>> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.
> 
> version (X86) {
>  ...
> } else {
>  ...
> }
> 

Win64 and all non X86 32bit versions would fall in the else statement. Actually I now saw that D already has a D_LP64 version identifier.
January 25, 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.

Actually I now saw that D already has a D_LP64 version identifier.
January 25, 2009
On Sun, 25 Jan 2009 17:30:38 +0300, Jacob Carlborg <doobnet@gmail.com> wrote:

> Denis Koroskin wrote:
>> On Sun, 25 Jan 2009 15:32:33 +0300, Jacob Carlborg <doobnet@gmail.com> wrote:
>>
>>> Could we get a LP64 version identifier? I know that you can use this code:
>>>
>>> "static if ((void*).sizeof > int.sizeof)"
>>>
>>> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.
>>  version (X86) {
>>  ...
>> } else {
>>  ...
>> }
>>
>
> Win64 and all non X86 32bit versions would fall in the else statement. Actually I now saw that D already has a D_LP64 version identifier.

Hm.. you are right.

January 25, 2009
On Sun, 25 Jan 2009 15:32:33 +0300, Jacob Carlborg <doobnet@gmail.com> wrote:

> Could we get a LP64 version identifier? I know that you can use this code:
>
> "static if ((void*).sizeof > int.sizeof)"
>
> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.

http://www.digitalmars.com/d/2.0/version.html

D_LP64	- Pointers are 64 bits

January 25, 2009
Denis Koroskin wrote:
> On Sun, 25 Jan 2009 15:32:33 +0300, Jacob Carlborg <doobnet@gmail.com> wrote:
> 
>> Could we get a LP64 version identifier? I know that you can use this code:
>>
>> "static if ((void*).sizeof > int.sizeof)"
>>
>> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.
> 
> http://www.digitalmars.com/d/2.0/version.html
> 
> D_LP64    - Pointers are 64 bits
> 

It's also in D1: http://www.digitalmars.com/d/1.0/version.html
January 25, 2009
Jacob Carlborg wrote:
> Could we get a LP64 version identifier? I know that you can use this code:
> 
> "static if ((void*).sizeof > int.sizeof)"
> 
> to do the same but that's not particular clear that the programmer wants to check for LP64. If so, I hope we could get it in D1 also.

Yeah, I agree, and it's already in both for the next update. It'll be D_LP64.
« First   ‹ Prev
1 2 3