mirror of
https://github.com/pocketpy/pocketpy
synced 2026-05-06 10:13:37 +00:00
* add some clang-format offs. * add formats. * format the world. * AllowShortIfStatementsOnASingleLine * off REGION. * Rollback vm.hpp * Disable insert.
35 lines
1.1 KiB
C++
35 lines
1.1 KiB
C++
#pragma once
|
|
|
|
#define PK_REGION(name) 1
|
|
|
|
#define PK_ALWAYS_PASS_BY_POINTER(T) \
|
|
T(const T&) = delete; \
|
|
T& operator= (const T&) = delete; \
|
|
T(T&&) = delete; \
|
|
T& operator= (T&&) = delete;
|
|
|
|
#define PK_SLICE_LOOP(i, start, stop, step) for(int i = start; step > 0 ? i < stop : i > stop; i += step)
|
|
|
|
namespace pkpy {
|
|
|
|
// global constants
|
|
const inline char* PK_HEX_TABLE = "0123456789abcdef";
|
|
|
|
const inline char* kPlatformStrings[] = {
|
|
"win32", // 0
|
|
"emscripten", // 1
|
|
"ios", // 2
|
|
"darwin", // 3
|
|
"android", // 4
|
|
"linux", // 5
|
|
"unknown" // 6
|
|
};
|
|
|
|
#ifdef _MSC_VER
|
|
#define PK_UNREACHABLE() __assume(0);
|
|
#else
|
|
#define PK_UNREACHABLE() __builtin_unreachable();
|
|
#endif
|
|
|
|
} // namespace pkpy
|