On 6/14/09 10:05 PM, Michael Wild said:

>On Mac OS X one shouldn't do this kind of detection during configure  
>step, because as has been mentioned a single file can be compiled  
>multiple times for different architectures during one single compiler  
>invocation. The size of void* and even endianness can change. It is  
>preferable to have a central config.h.in (or similar) containing  
>something like this:
>
>#if defined(__APPLE__)
>#  if defined(__i386__)
>#    undef HAVE_64_BIT
>#    undef HAVE_BIG_ENDIAN
>#  elif defined(__ppc__)
>#    undef HAVE_64_BIT
>#    define HAVE_BIG_ENDIAN
>#  elif defined(__x86_64__)
>#    define HAVE_64_BIT
>#    undef HAVE_BIG_ENDIAN
>#  elif defined(__ppc64__)
>#    define HAVE_64_BIT
>#    define HAVE_BIG_ENDIAN
>#  else
>      // oops
>#    error "Unknown architecture!"
>#  endif
>#else
>#  cmakedefine HAVE_64_BIT
>#  cmakedefine HAVE_BIG_ENDIAN
>#endif

I agree with Hendrik that such things are better done with types like
uin32_t, etc.  The quoted stuff above will fail with OS X running on ARM
(ie iPhone).

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


_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to