[Qt-interest] Detecting size of datatype with qmake

Nikos Chantziaras realnc at arcor.de
Sun May 16 09:18:11 CEST 2010


On 05/16/2010 10:00 AM, Esben Mose Hansen wrote:
> On Sunday 16 May 2010 04:47:32 Nikos Chantziaras wrote:
>> Is there a way I could detect the size of datatypes like 'short' and
>> 'int' with qmake from within the project file?  I am working with a
>> header file that needs macros like SIZEOF_SHORT and SIZEOF_INT defined.
>
> Why not simply use
>
> #define SIZEOF_SHORT sizeof(short)
> #define SIZEOF_INT sizeof(int)

Because those macros are used like this:

   #if SIZEOF_INT == 4
     typedef int hix_int32;
   // ...

and the rest of the code uses hix_int32.



More information about the Qt-interest-old mailing list