intptr.hpp 969 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. /*
  2. * Distributed under the Boost Software License, Version 1.0.
  3. * (See accompanying file LICENSE_1_0.txt or copy at
  4. * http://www.boost.org/LICENSE_1_0.txt)
  5. *
  6. * Copyright (c) 2020-2025 Andrey Semashev
  7. */
  8. /*!
  9. * \file atomic/detail/intptr.hpp
  10. *
  11. * This header defines (u)intptr_t types.
  12. */
  13. #ifndef BOOST_ATOMIC_DETAIL_INTPTR_HPP_INCLUDED_
  14. #define BOOST_ATOMIC_DETAIL_INTPTR_HPP_INCLUDED_
  15. #include <cstdint>
  16. #if !defined(UINTPTR_MAX)
  17. #include <cstddef>
  18. #endif
  19. #include <boost/atomic/detail/config.hpp>
  20. #include <boost/atomic/detail/header.hpp>
  21. #ifdef BOOST_HAS_PRAGMA_ONCE
  22. #pragma once
  23. #endif
  24. namespace boost {
  25. namespace atomics {
  26. namespace detail {
  27. #if defined(UINTPTR_MAX)
  28. using std::uintptr_t;
  29. using std::intptr_t;
  30. #else
  31. using uintptr_t = std::size_t;
  32. using intptr_t = std::ptrdiff_t;
  33. #endif
  34. } // namespace detail
  35. } // namespace atomics
  36. } // namespace boost
  37. #include <boost/atomic/detail/footer.hpp>
  38. #endif // BOOST_ATOMIC_DETAIL_INTPTR_HPP_INCLUDED_