Skip to content

Commit

Permalink
missing file
Browse files Browse the repository at this point in the history
  • Loading branch information
dylan-conway committed Nov 22, 2024
1 parent 2195613 commit 3247017
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions Source/WTF/wtf/BunStdExtras.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#pragma once

#include <bit>

#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

0 comments on commit 3247017

Please sign in to comment.