32 lines
760 B
C++
32 lines
760 B
C++
#pragma once
|
|
|
|
#include <cstdint>
|
|
static_assert(sizeof(float) == 4);
|
|
static_assert(sizeof(double) == 8);
|
|
typedef float f32;
|
|
typedef double f64;
|
|
typedef int8_t i8;
|
|
typedef uint8_t u8;
|
|
typedef int16_t i16;
|
|
typedef uint16_t u16;
|
|
typedef int32_t i32;
|
|
typedef uint32_t u32;
|
|
typedef int64_t i64;
|
|
typedef uint64_t u64;
|
|
|
|
#include <string>
|
|
|
|
#include <locale>
|
|
#include <codecvt>
|
|
|
|
|
|
namespace NVL {
|
|
using Number = f32;
|
|
using Char = char16_t;
|
|
using String = std::u16string;
|
|
|
|
static std::wstring_convert<std::codecvt_utf8_utf16<Char>, Char> str_converter;
|
|
|
|
inline static std::string to_std_string(const String& s) noexcept { return str_converter.to_bytes(s); }
|
|
inline static String to_NVL_string(const std::string& s) noexcept { return str_converter.from_bytes(s); }
|
|
}
|