This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] Define _LP64 on x86-64?


On Wed, Mar 12, 2003 at 08:44:54AM +0100, Andreas Jaeger wrote:
> To get the size of the pointer I use TYPE_PRECISION (size_type_node).
> I tried TYPE_PRECISON(ptr_type_node) but this is always zero. Is
> size_type_node the right think to do or is there a better solution?

POINTER_SIZE is exactly what you want.

> +  /* Definitions for LP64 model.  */
> +  if (TYPE_PRECISION (long_integer_type_node) == 64
> +      && TYPE_PRECISION (size_type_node) == 64
> +      && TYPE_PRECISION (integer_type_node) == 32)

I guess this is ok.  I'm agnostic as to whether "int" matters
here one way or another.

You'll want to document this in cpp.texi.


r~


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]