endian.hpp 602 B

123456789101112131415161718192021222324252627282930313233343536373839
  1. // Copyright 2017, 2018 Peter Dimov.
  2. // Distributed under the Boost Software License, Version 1.0.
  3. // https://www.boost.org/LICENSE_1_0.txt
  4. #ifndef BOOST_HASH2_ENDIAN_HPP_INCLUDED
  5. #define BOOST_HASH2_ENDIAN_HPP_INCLUDED
  6. namespace boost
  7. {
  8. namespace hash2
  9. {
  10. #if defined(_MSC_VER)
  11. enum class endian
  12. {
  13. little,
  14. big,
  15. native = little
  16. };
  17. #else
  18. // GCC 4.6+, Clang 3.2+
  19. enum class endian
  20. {
  21. little = __ORDER_LITTLE_ENDIAN__,
  22. big = __ORDER_BIG_ENDIAN__,
  23. native = __BYTE_ORDER__
  24. };
  25. #endif
  26. } // namespace hash2
  27. } // namespace boost
  28. #endif // #ifndef BOOST_HASH2_ENDIAN_HPP_INCLUDED