User-defined literals

This commit is contained in:
wheremyfoodat 2023-07-27 15:09:52 +03:00 committed by georgemoralis
parent 441471370e
commit c0c6024e2c
3 changed files with 9 additions and 3 deletions

View file

@ -13,4 +13,10 @@ using u64 = unsigned long long;
using f32 = float;
using f64 = double;
#define PS4_SYSV_ABI __attribute__((sysv_abi))
#define PS4_SYSV_ABI __attribute__((sysv_abi))
// UDLs for memory size values
constexpr u64 operator""_KB(u64 x) { return 1024ULL * x; }
constexpr u64 operator""_MB(u64 x) { return 1024_KB * x; }
constexpr u64 operator""_GB(u64 x) { return 1024_MB * x; }