diff options
author | bunnei <bunneidev@gmail.com> | 2021-06-25 04:09:12 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-06-25 04:09:12 +0200 |
commit | b9c2732121e2594a64d1141807c7d5bd0f317d0f (patch) | |
tree | 700ab748e15d1e7d5cf7f58f2cbac133b7a84915 /src/common/literals.h | |
parent | Merge pull request #6522 from Morph1984/pragma (diff) | |
parent | common: Replace common_sizes into user-literals (diff) | |
download | yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.gz yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.bz2 yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.lz yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.xz yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.tar.zst yuzu-b9c2732121e2594a64d1141807c7d5bd0f317d0f.zip |
Diffstat (limited to 'src/common/literals.h')
-rw-r--r-- | src/common/literals.h | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/common/literals.h b/src/common/literals.h new file mode 100644 index 000000000..d55fed40b --- /dev/null +++ b/src/common/literals.h @@ -0,0 +1,31 @@ +// Copyright 2021 yuzu emulator team +// Licensed under GPLv2 or any later version +// Refer to the license.txt file included. + +#pragma once + +#include "common/common_types.h" + +namespace Common::Literals { + +constexpr u64 operator""_KiB(unsigned long long int x) { + return 1024ULL * x; +} + +constexpr u64 operator""_MiB(unsigned long long int x) { + return 1024_KiB * x; +} + +constexpr u64 operator""_GiB(unsigned long long int x) { + return 1024_MiB * x; +} + +constexpr u64 operator""_TiB(unsigned long long int x) { + return 1024_GiB * x; +} + +constexpr u64 operator""_PiB(unsigned long long int x) { + return 1024_TiB * x; +} + +} // namespace Common::Literals |