diff --git a/cpp/types.hpp b/cpp/types.hpp index e6d7433..5f7d138 100644 --- a/cpp/types.hpp +++ b/cpp/types.hpp @@ -43,6 +43,28 @@ typedef unsigned __int128 rk_ullong; typedef float rk_float; typedef void * rk_handle_t; -#define RK_INVALID_HANDLE nullptr +static_assert(sizeof(rk_char) == 1); +static_assert(sizeof(rk_wchar) == 4); +static_assert(sizeof(rk_float) == 4); + +#pragma pack(push, 4) + +template +struct rk_packed { +}; + +template +struct alignas(alignof(rk_int)) rk_packed { + typedef rk_int type; + rk_int packed; +}; + +template +struct alignas(alignof(rk_uint)) rk_packed { + typedef rk_uint type; + rk_uint packed; +}; + +#pragma pack(pop) #endif // _RK_ENGINE_TYPES_H