Add template for packed ints and fix missing define.
This commit is contained in:
parent
a6ec35ebd1
commit
9181d58ecd
@ -43,6 +43,28 @@ typedef unsigned __int128 rk_ullong;
|
|||||||
typedef float rk_float;
|
typedef float rk_float;
|
||||||
typedef void * rk_handle_t;
|
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<bool _signed, unsigned _cols>
|
||||||
|
struct rk_packed {
|
||||||
|
};
|
||||||
|
|
||||||
|
template<unsigned _cols>
|
||||||
|
struct alignas(alignof(rk_int)) rk_packed<true, _cols> {
|
||||||
|
typedef rk_int type;
|
||||||
|
rk_int packed;
|
||||||
|
};
|
||||||
|
|
||||||
|
template<unsigned _cols>
|
||||||
|
struct alignas(alignof(rk_uint)) rk_packed<false, _cols> {
|
||||||
|
typedef rk_uint type;
|
||||||
|
rk_uint packed;
|
||||||
|
};
|
||||||
|
|
||||||
|
#pragma pack(pop)
|
||||||
|
|
||||||
#endif // _RK_ENGINE_TYPES_H
|
#endif // _RK_ENGINE_TYPES_H
|
||||||
|
Loading…
Reference in New Issue
Block a user