#define _GLIBCXX_ALIGN_H 1
#include <bit> // std::has_single_bit
-#include <stdint.h> // uintptr_t
#include <debug/assertions.h> // _GLIBCXX_DEBUG_ASSERT
#include <bits/version.h>
{
if (__space < __size)
return nullptr;
- const auto __intptr = reinterpret_cast<uintptr_t>(__ptr);
+ const auto __intptr = reinterpret_cast<__UINTPTR_TYPE__>(__ptr);
const auto __aligned = (__intptr - 1u + __align) & -__align;
const auto __diff = __aligned - __intptr;
if (__diff > (__space - __size))
{
// This function is expected to be used in hot code, where
// __glibcxx_assert would add unwanted overhead.
- _GLIBCXX_DEBUG_ASSERT((uintptr_t)__ptr % _Align == 0);
+ _GLIBCXX_DEBUG_ASSERT((__UINTPTR_TYPE__)__ptr % _Align == 0);
return static_cast<_Tp*>(__builtin_assume_aligned(__ptr, _Align));
}
}
#include <bits/c++config.h>
#include <new> // For placement new
-#include <stdint.h>
#include <bits/atomic_lockfree_defines.h>
#include <bits/move.h>
explicit
__atomic_ref(_Tp& __t) : _M_ptr(std::__addressof(__t))
- { __glibcxx_assert(((uintptr_t)_M_ptr % required_alignment) == 0); }
+ {
+ __glibcxx_assert(((__UINTPTR_TYPE__)_M_ptr % required_alignment) == 0);
+ }
__atomic_ref(const __atomic_ref&) noexcept = default;
explicit
__atomic_ref(_Tp& __t) : _M_ptr(&__t)
- { __glibcxx_assert(((uintptr_t)_M_ptr % required_alignment) == 0); }
+ {
+ __glibcxx_assert(((__UINTPTR_TYPE__)_M_ptr % required_alignment) == 0);
+ }
__atomic_ref(const __atomic_ref&) noexcept = default;
explicit
__atomic_ref(_Fp& __t) : _M_ptr(&__t)
- { __glibcxx_assert(((uintptr_t)_M_ptr % required_alignment) == 0); }
+ {
+ __glibcxx_assert(((__UINTPTR_TYPE__)_M_ptr % required_alignment) == 0);
+ }
__atomic_ref(const __atomic_ref&) noexcept = default;
explicit
__atomic_ref(_Tp*& __t) : _M_ptr(std::__addressof(__t))
- { __glibcxx_assert(((uintptr_t)_M_ptr % required_alignment) == 0); }
+ {
+ __glibcxx_assert(((__UINTPTR_TYPE__)_M_ptr % required_alignment) == 0);
+ }
__atomic_ref(const __atomic_ref&) noexcept = default;
static __waiter_pool_base&
_S_for(const void* __addr) noexcept
{
- constexpr uintptr_t __ct = 16;
+ constexpr __UINTPTR_TYPE__ __ct = 16;
static __waiter_pool_base __w[__ct];
- auto __key = (uintptr_t(__addr) >> 2) % __ct;
+ auto __key = ((__UINTPTR_TYPE__)__addr >> 2) % __ct;
return __w[__key];
}
};
#include <bits/version.h>
#include <bits/atomic_base.h>
+#include <cstdint>
namespace std _GLIBCXX_VISIBILITY(default)
{