[CMake] OS X architecture changes interfere with CheckTypeSize()?

Sean McBride sean at rogue-research.com
Wed Aug 11 14:08:26 EDT 2010


On Wed, 11 Aug 2010 18:08:35 +0200, Erik Lindahl said:

>All the CheckTypeSize() tests then seem to run directly when e.g. ccmake
>is invoked, and they thus set all SIZEOF_XXX defines to the 64-bit
>values (e.g. 8 for "long int").

Why do you need to know the size of 'long'?  Its size is not guaranteed
by the language spec.  If you're writing portable code, you should not
assume any more than the language guarantees.

If you need an integer of a specific size, use types like int32_t or
int64_t.  These are part of C99 and C++0x.  If they don't exist on some
platform you need to support, they are easy to typedef.

That said, if you already have a tonne of code.....

-- 
____________________________________________________________
Sean McBride, B. Eng                 sean at rogue-research.com
Rogue Research                        www.rogue-research.com 
Mac Software Developer              Montréal, Québec, Canada




More information about the CMake mailing list