sandbox/defs.h

27 lines
421 B
C
Raw Normal View History

2018-02-22 19:38:27 +00:00
#ifndef __KF_DEFS_H__
#define __KF_DEFS_H__
#ifdef __linux__
#include "linux/defs.h"
#else
typedef int KF_INT;
typedef long KF_LONG;
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__