Switch atmosphere's build target to C++20. (#952)
* ams: update to build with gcc10/c++20 * remove mno-outline-atomics * ams: take care of most TODO C++20s * fusee/sept: update for gcc10 * whoosh, your code now uses pre-compiled headers * make: dependency fixes
This commit is contained in:
@@ -23,15 +23,13 @@
|
||||
|
||||
namespace ams::crypto::impl {
|
||||
|
||||
/* TODO: C++20
|
||||
template<typename T>
|
||||
concept HashFunction = requires(T &t, const void *cv, void *v, size_t sz) {
|
||||
{ T::HashSize } -> std::same_as<size_t>;
|
||||
{ T::BlockSize } -> std::same_as<size_t>;
|
||||
{ t.Initialize() } -> std::same_as<void>;
|
||||
{ t.Update(cv, sz) } -> std::same_as<void>;
|
||||
{ t.GetHash(v, sz) } -> std::same_as<void>;
|
||||
};
|
||||
*/
|
||||
template<typename T>
|
||||
concept HashFunction = requires(T &t, const void *cv, void *v, size_t sz) {
|
||||
{ T::HashSize } -> std::convertible_to<size_t>;
|
||||
{ T::BlockSize } -> std::convertible_to<size_t>;
|
||||
{ t.Initialize() } -> std::same_as<void>;
|
||||
{ t.Update(cv, sz) } -> std::same_as<void>;
|
||||
{ t.GetHash(v, sz) } -> std::same_as<void>;
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace ams::crypto::impl {
|
||||
|
||||
template<typename Hash> /* requires HashFunction<Hash> */
|
||||
template<typename Hash> requires HashFunction<Hash>
|
||||
class RsaOaepImpl {
|
||||
NON_COPYABLE(RsaOaepImpl);
|
||||
NON_MOVEABLE(RsaOaepImpl);
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
|
||||
namespace ams::crypto::impl {
|
||||
|
||||
template<typename Hash> /* requires HashFunction<Hash> */
|
||||
template<typename Hash> requires HashFunction<Hash>
|
||||
class RsaPssImpl {
|
||||
NON_COPYABLE(RsaPssImpl);
|
||||
NON_MOVEABLE(RsaPssImpl);
|
||||
|
||||
@@ -66,6 +66,6 @@ namespace ams::crypto::impl {
|
||||
}
|
||||
};
|
||||
|
||||
/* static_assert(HashFunction<Sha256Impl>); */
|
||||
static_assert(HashFunction<Sha256Impl>);
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user