core: Abstract sockets

This commit is contained in:
GPUCode
2023-07-07 21:44:34 +03:00
parent 4ccd9f24fb
commit e5495cbc4b
20 changed files with 1679 additions and 540 deletions

23
src/common/bit_cast.h Normal file
View File

@ -0,0 +1,23 @@
// SPDX-FileCopyrightText: Copyright 2020 yuzu Emulator Project
// SPDX-License-Identifier: GPL-2.0-or-later
#pragma once
#include <version>
#ifdef __cpp_lib_bit_cast
#include <bit>
#endif
namespace Common {
template <typename To, typename From>
constexpr inline To BitCast(const From& from) {
#ifdef __cpp_lib_bit_cast
return std::bit_cast<To>(from);
#else
return __builtin_bit_cast(To, from);
#endif
}
} // namespace Common