Reputation:
I'm going to upgrade my VC++ 2008 into VC++ 2010 or 2012. Before upgrading I have some questions:
My compiler only supports the largest __int64
integers. Is __int128
supported in version VC++ 2010, 2012 and so on?
My current compiler doesn't support something like _WIN64
or _WIN32
to check the Windows platform. But I doubt _INTEGRAL_MAX_BITS
is an another solution; It will be 64
if it's run in Win32, or 128
otherwise. Is it true?
Upvotes: 1
Views: 2526
Reputation: 558
In the C++ standard there is a dedicated section for what you want, in short there is <limits>
and the included methods that are a solution to your problem.
EDIT: I'm assuming that you want some kind of standardize support, otherwise you should simply refer to the online docs for your compiler
Upvotes: 1
Reputation: 612964
For all of the compilers that you mention, 64 bit integer types exist for both 32 and 64 bit targets. However, there are no 128 bit integer types. So, _INTEGRAL_MAX_BITS
evaluates to 64 for all of the listed compilers, and for both 32 and 64 bit targets.
The best you can do is probably to use the SSE2 intrinsic __m128i
but that depends on the presence of an SSE2 unit on the processor. But you don't need to upgrade to be able to use that. It's available in VS2008 also.
Upvotes: 1