Skip to content

Commit

Permalink
move out of WTF namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-conway committed Nov 21, 2024
1 parent 1ca30d9 commit 5e0e669
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions Source/WTF/wtf/StdLibExtras.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,20 @@

WTF_ALLOW_UNSAFE_BUFFER_USAGE_BEGIN

#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
#define __bit_cast std::bit_cast
#else
template <
typename Dest, typename Source,
typename std::enable_if<sizeof(Dest) == sizeof(Source) &&
std::is_trivially_copyable<Source>::value &&
std::is_trivially_copyable<Dest>::value,
int>::type = 0>
inline constexpr Dest __bit_cast(const Source &source) {
return __builtin_bit_cast(Dest, source);
}
#endif

#define SINGLE_ARG(...) __VA_ARGS__ // useful when a macro argument includes a comma

// Use this macro to declare and define a debug-only global variable that may have a
Expand Down Expand Up @@ -140,20 +154,6 @@ inline bool isPointerTypeAlignmentOkay(Type*)

namespace WTF {

#if defined(__cpp_lib_bit_cast) && __cpp_lib_bit_cast >= 201806L
#define __bit_cast std::bit_cast
#else
template <
typename Dest, typename Source,
typename std::enable_if<sizeof(Dest) == sizeof(Source) &&
std::is_trivially_copyable<Source>::value &&
std::is_trivially_copyable<Dest>::value,
int>::type = 0>
inline constexpr Dest __bit_cast(const Source &source) {
return __builtin_bit_cast(Dest, source);
}
#endif

enum CheckMoveParameterTag { CheckMoveParameter };

static constexpr size_t KB = 1024;
Expand Down

0 comments on commit 5e0e669

Please sign in to comment.