literals.h 660 B

12345678910111213141516171819202122232425262728293031
  1. // Copyright 2021 yuzu emulator team
  2. // Licensed under GPLv2 or any later version
  3. // Refer to the license.txt file included.
  4. #pragma once
  5. #include "common/common_types.h"
  6. namespace Common::Literals {
  7. constexpr u64 operator""_KiB(unsigned long long int x) {
  8. return 1024ULL * x;
  9. }
  10. constexpr u64 operator""_MiB(unsigned long long int x) {
  11. return 1024_KiB * x;
  12. }
  13. constexpr u64 operator""_GiB(unsigned long long int x) {
  14. return 1024_MiB * x;
  15. }
  16. constexpr u64 operator""_TiB(unsigned long long int x) {
  17. return 1024_GiB * x;
  18. }
  19. constexpr u64 operator""_PiB(unsigned long long int x) {
  20. return 1024_TiB * x;
  21. }
  22. } // namespace Common::Literals