boost_no_integral_int64_t.ipp 1.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  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_NO_INTEGRAL_INT64_T
  7. // TITLE: long long and integral constant expressions
  8. // DESCRIPTION: The platform supports long long in integral constant expressions.
  9. #include <cstdlib>
  10. namespace boost_no_integral_int64_t{
  11. #ifdef BOOST_NO_INCLASS_MEMBER_INITIALIZATION
  12. enum{ mask = 1uLL << 50 };
  13. template <unsigned long long m>
  14. struct llt
  15. {
  16. enum{ value = m };
  17. };
  18. #else
  19. #ifdef __GNUC__
  20. __extension__
  21. #endif
  22. static const unsigned long long mask = 1uLL << 50;
  23. #ifdef __GNUC__
  24. __extension__
  25. #endif
  26. template <unsigned long long m>
  27. struct llt
  28. {
  29. #ifdef __GNUC__
  30. __extension__
  31. #endif
  32. static const unsigned long long value = m;
  33. };
  34. #endif
  35. int test()
  36. {
  37. return llt<mask>::value != (1uLL << 50);
  38. }
  39. }