boost_has_stdint_h.ipp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. // (C) Copyright John Maddock 2001.
  2. // Use, modification and distribution are subject to the
  3. // Boost Software License, Version 1.0. (See accompanying file
  4. // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
  5. // See http://www.boost.org/libs/config for most recent version.
  6. // MACRO: BOOST_HAS_STDINT_H
  7. // TITLE: stdint.h
  8. // DESCRIPTION: There are no 1998 C++ Standard headers <stdint.h>
  9. // or <cstdint>, although the 1999 C Standard does
  10. // include <stdint.h>.
  11. // If <stdint.h> is present, <boost/stdint.h> can make
  12. // good use of it, so a flag is supplied (signalling
  13. // presence; thus the default is not present, conforming
  14. // to the current C++ standard).
  15. # if defined(__hpux) || defined(__FreeBSD__) || defined(__IBMCPP__)
  16. # include <inttypes.h>
  17. # else
  18. # include <stdint.h>
  19. # endif
  20. namespace boost_has_stdint_h{
  21. int test()
  22. {
  23. int8_t i = 0;
  24. #ifndef __QNX__
  25. // QNX has these under non-standard names, our cstdint.hpp will find them however:
  26. int_fast8_t j = 0;
  27. int_least8_t k = 0;
  28. (void)j;
  29. (void)k;
  30. #endif
  31. (void)i;
  32. return 0;
  33. }
  34. }