On Sat, Aug 30, 2014 at 10:30 AM, Rolf Eike Beer <[email protected]> wrote:

> > # Checks for typedefs, structures, and compiler characteristics.
> > #AC_C_CONST
> > #AC_C_INLINE
> ...
> > #AC_TYPE_SIZE_T
> ...
>
> #AC_C_RESTRICT
> > #AC_C_VOLATILE
>

These should be generally safe to assume


> #AC_STRUCT_TM
> > #AC_HEADER_TIME
>

Unless you're targeting embedded systems and / or microcontrollors then you
shouldn't have a problem with these either, even still there's a good
chance you'd have it.


> #AC_TYPE_INT16_T
> > #AC_TYPE_INT32_T
> > #AC_TYPE_INT64_T
> > #AC_TYPE_INT8_T
> > #AC_TYPE_UINT16_T
> > #AC_TYPE_UINT32_T
> > #AC_TYPE_UINT64_T
> > #AC_TYPE_UINT8_T
>
> This is basically "is there a usable <stdint.h>" or <cstdint>. The latter
> you
> will find in newer versions of MSVC and everything else that understands
> recent
> C++, the former in every compiler supporting at least a decent level of
> C99,
> which _excludes_ MSVC for policy reasons that even MS will probably find
> hard
> to explain. So you usually don't check for these types but for the header.
>

Ugh, this is definitely one of those irritating Windows-isms. cstdint is
guaranteed available in C++11, so if you require that then most of this
goes away. stdint.h, as Rolf mentioned, wasn't available until VS2010, so
if you can place that as a requirement then you're all set. You can
restrict this in your top level cmake with something like this:

if(MSVC_VERSION LESS 1700)
  message(FATAL_ERROR "Only Visual C++ 2010 or greater is supported")
endif()

However, if you do have to support older MSVC versions then this is a
problem and you will need to either redefine the types or include your own
stdint.h (bringing the header is usally easier), a commonly used one by
numerous projects for porting unix -> windows can be found here:
https://code.google.com/p/msinttypes/source/browse/trunk/stdint.h.
-- 

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

Follow this link to subscribe/unsubscribe:
http://public.kitware.com/mailman/listinfo/cmake

Reply via email to