[Qt-interest] Indentify 64 bit

Paul Floyd paulf at free.fr
Thu Jul 2 20:16:59 CEST 2009


Stefano Rosellini wrote:
> Paul Floyd ha scritto:

>>Are you looking for something to tell if the code is 64bit or not? Some of the
>>Q_OS macros will tell you this (e.g., for Windows or Mac). Otherwise something
>>like
>>
>>8 == sizeof(void*)  
> 
> Thanks Paul, but I need a preprocess, not a runtime check. And it should 
> be platform independent.

Other than C99 VLAs (and any nonstandard C++ compilers that permit 
VLAs), then sizeof is a compile time constant. void* certainly isn't a 
VLA, so sizeof(void*) is a compile time constant.

Are there any platforms that Qt supports where a 64bit platform has a 
pointer size other than 8 bytes? I doubt it, any such platform would be 
extremely esoteric.

A+
Paul
-- 
Paul Floyd                 http://paulf.free.fr




More information about the Qt-interest-old mailing list