2018-02-22 19:38:27 +00:00
|
|
|
#ifndef __KF_DEFS_H__
|
|
|
|
#define __KF_DEFS_H__
|
|
|
|
|
|
|
|
#ifdef __linux__
|
|
|
|
#include "linux/defs.h"
|
2018-02-24 03:19:29 +00:00
|
|
|
#else
|
|
|
|
typedef int KF_INT;
|
2018-02-28 03:59:29 +00:00
|
|
|
typedef long KF_LONG;
|
2018-02-24 03:19:29 +00:00
|
|
|
constexpr uint8_t STACK_SIZE = 16;
|
2018-02-22 19:38:27 +00:00
|
|
|
#endif
|
|
|
|
|
2018-02-23 22:01:52 +00:00
|
|
|
constexpr size_t MAX_TOKEN_LENGTH = 16;
|
2018-03-02 04:04:34 +00:00
|
|
|
constexpr size_t dshift = (sizeof(KF_INT) * 8) - 1;
|
|
|
|
|
|
|
|
static inline KF_INT
|
|
|
|
mask(size_t bits)
|
|
|
|
{
|
|
|
|
KF_INT m = 0;
|
|
|
|
|
|
|
|
for (size_t i = 0; i < bits; i++) {
|
|
|
|
m += 1 << i;
|
|
|
|
}
|
|
|
|
|
|
|
|
return m;
|
|
|
|
}
|
2018-02-22 19:38:27 +00:00
|
|
|
|
|
|
|
#endif // __KF_DEFS_H__
|