mirror of
https://github.com/wichtounet/thor-os.git
synced 2025-09-10 13:04:53 -04:00
28 lines
780 B
C++
28 lines
780 B
C++
//=======================================================================
|
|
// Copyright Baptiste Wicht 2013-2016.
|
|
// Distributed under the terms of the MIT License.
|
|
// (See accompanying file LICENSE or copy at
|
|
// http://www.opensource.org/licenses/MIT)
|
|
//=======================================================================
|
|
|
|
#ifndef LITERALS_HPP
|
|
#define LITERALS_HPP
|
|
|
|
#include <types.hpp>
|
|
|
|
static_assert(sizeof(size_t) == sizeof(unsigned long long), "Unmatching sizes for literals");
|
|
|
|
inline constexpr size_t operator"" _GiB (unsigned long long n){
|
|
return n * 1024 * 1024 * 1024;
|
|
}
|
|
|
|
inline constexpr size_t operator"" _MiB (unsigned long long n){
|
|
return n * 1024 * 1024;
|
|
}
|
|
|
|
inline constexpr size_t operator"" _KiB (unsigned long long n){
|
|
return n * 1024;
|
|
}
|
|
|
|
#endif
|