diff options
author | Wunkolo <Wunkolo@gmail.com> | 2021-06-23 23:18:27 +0200 |
---|---|---|
committer | Wunkolo <Wunkolo@gmail.com> | 2021-06-24 18:27:40 +0200 |
commit | 4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c (patch) | |
tree | 591792bc47e26bc812e753b0891aab94a8a88352 /src/common/literals.h | |
parent | Merge pull request #6504 from Kelebek1/samples-played (diff) | |
download | yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.tar yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.tar.gz yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.tar.bz2 yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.tar.lz yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.tar.xz yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.tar.zst yuzu-4569f39c7c1e3d7ce010f0b120e1f45dbba17b1c.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 |