This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: [libstdc++]


Hi,

Something like the following is required for Win64, which is a P64 target.


I'm sure, I already briefly considered this issue, don't remember exactly the context.

I'm not sure what's required generically to assert that intptr_t is
present; certainly it's available on Linux and Win64...


Yes, that's a problem, it's available only in C99, and we can't assume that kind of libc, in general. I don't know, maybe we can use long long (or maybe better, unsigned long long), and choose the right type via something like:

typedef __gnu_cxx::__conditional_type<(sizeof(const void*) <= sizeof(unsigned long)), unsigned long, unsigned long long>::__type _UIntPtrType;

Is it sufficient to cover all the targets where libstdc++ actually works? One, more general issue in the context of C++03, is that if _GLIBCXX_USE_LONG_LONG is undefined neither unsigned long long (neither uintptr_t for that matter) can be output because operator<<(unsigned long long) is missing. Probably, however, that problem isn't real anymore, because long long is already in the working draft of C++0x and we can assume it to be available unconditionally.

Paolo.


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