diff mbox

[Libiberty] : Handle VMS as a LLP64 platform in splay-tree.h

Message ID 991EB52A-1080-4EED-8D17-2E73BF8050A0@adacore.com
State New
Headers show

Commit Message

Tristan Gingold April 4, 2012, 8:55 a.m. UTC
Hi,

unfortunately VMS (when 64bit pointers are used - which is nice for gcc) is also an LLP64 platform.
So I need to follow to Win64 way in splay-tree.h.

Tested manually by build (and using) gcc on ia64-hp-openvms.

Ok for trunk ?

Tristan.

include/
2012-04-04  Tristan Gingold  <gingold@adacore.com>

	* splay-tree.h: Use LLP64 definitions of libi_shostptr_t and
	libi_hostptr_t for VMS with 64bit pointers.

Comments

Pedro Alves April 4, 2012, 9:26 a.m. UTC | #1
On 04/04/2012 09:55 AM, Tristan Gingold wrote:

> Hi,
> 
> unfortunately VMS (when 64bit pointers are used - which is nice for gcc) is also an LLP64 platform.
> So I need to follow to Win64 way in splay-tree.h.


Doesn't VMS gcc define __LP64__/__LLP64__?  Then we could for example:

#if !(defined (_WIN64) || defined (__LLP64__))

and thus avoid sprinkling __VMS__ checks around.

> 
> Tested manually by build (and using) gcc on ia64-hp-openvms.
> 
> Ok for trunk ?
> 
> Tristan.
> 
> include/
> 2012-04-04  Tristan Gingold  <gingold@adacore.com>
> 
> 	* splay-tree.h: Use LLP64 definitions of libi_shostptr_t and
> 	libi_hostptr_t for VMS with 64bit pointers.
> 
> --- a/include/splay-tree.h
> +++ b/include/splay-tree.h
> @@ -37,7 +37,8 @@ extern "C" {
>  
>  #include "ansidecl.h"
>  
> -#ifndef _WIN64
> +#if !(defined (_WIN64) \
> +      || (defined (__VMS__) && __INITIAL_POINTER_SIZE == 64))
>    typedef unsigned long int libi_uhostptr_t;
>    typedef long int libi_shostptr_t;
>  #else
>
Tristan Gingold April 4, 2012, 9:44 a.m. UTC | #2
On Apr 4, 2012, at 11:26 AM, Pedro Alves wrote:

> On 04/04/2012 09:55 AM, Tristan Gingold wrote:
> 
>> Hi,
>> 
>> unfortunately VMS (when 64bit pointers are used - which is nice for gcc) is also an LLP64 platform.
>> So I need to follow to Win64 way in splay-tree.h.
> 
> 
> Doesn't VMS gcc define __LP64__/__LLP64__?

Unfortunately no (like mingw if I read config files correctly).

This makes even less sense on VMS where 32bit and 64bit can be used at the same time.

>  Then we could for example:
> 
> #if !(defined (_WIN64) || defined (__LLP64__))
> 
> and thus avoid sprinkling __VMS__ checks around.

In fact this is the only place where we need it, so this is under control :-)

Tristan.

> 
>> 
>> Tested manually by build (and using) gcc on ia64-hp-openvms.
>> 
>> Ok for trunk ?
>> 
>> Tristan.
>> 
>> include/
>> 2012-04-04  Tristan Gingold  <gingold@adacore.com>
>> 
>> 	* splay-tree.h: Use LLP64 definitions of libi_shostptr_t and
>> 	libi_hostptr_t for VMS with 64bit pointers.
>> 
>> --- a/include/splay-tree.h
>> +++ b/include/splay-tree.h
>> @@ -37,7 +37,8 @@ extern "C" {
>> 
>> #include "ansidecl.h"
>> 
>> -#ifndef _WIN64
>> +#if !(defined (_WIN64) \
>> +      || (defined (__VMS__) && __INITIAL_POINTER_SIZE == 64))
>>   typedef unsigned long int libi_uhostptr_t;
>>   typedef long int libi_shostptr_t;
>> #else
>> 
> 
> 
> 
> -- 
> Pedro Alves
Ian Lance Taylor April 4, 2012, 1:58 p.m. UTC | #3
Tristan Gingold <gingold@adacore.com> writes:

> include/
> 2012-04-04  Tristan Gingold  <gingold@adacore.com>
>
> 	* splay-tree.h: Use LLP64 definitions of libi_shostptr_t and
> 	libi_hostptr_t for VMS with 64bit pointers.

I was strongly opposed to adding a _WIN64 define here and this is just
making it worse.

Ian


> --- a/include/splay-tree.h
> +++ b/include/splay-tree.h
> @@ -37,7 +37,8 @@ extern "C" {
>  
>  #include "ansidecl.h"
>  
> -#ifndef _WIN64
> +#if !(defined (_WIN64) \
> +      || (defined (__VMS__) && __INITIAL_POINTER_SIZE == 64))
>    typedef unsigned long int libi_uhostptr_t;
>    typedef long int libi_shostptr_t;
>  #else
diff mbox

Patch

--- a/include/splay-tree.h
+++ b/include/splay-tree.h
@@ -37,7 +37,8 @@  extern "C" {
 
 #include "ansidecl.h"
 
-#ifndef _WIN64
+#if !(defined (_WIN64) \
+      || (defined (__VMS__) && __INITIAL_POINTER_SIZE == 64))
   typedef unsigned long int libi_uhostptr_t;
   typedef long int libi_shostptr_t;
 #else