mirror of
https://github.com/pocketpy/pocketpy
synced 2025-10-20 19:40:18 +00:00
move static_assert
This commit is contained in:
parent
697312cae5
commit
601c1029ce
@ -1,10 +1,5 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <assert.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "pocketpy/common/utils.h"
|
||||
#include "pocketpy/pocketpy.h"
|
||||
|
||||
typedef struct PyObject PyObject;
|
||||
@ -26,8 +21,3 @@ typedef struct py_TValue {
|
||||
c11_vec2i _vec2i;
|
||||
};
|
||||
} py_TValue;
|
||||
|
||||
// 16 bytes to make py_arg() macro work
|
||||
static_assert(sizeof(py_CFunction) <= 8, "sizeof(py_CFunction) > 8");
|
||||
static_assert(sizeof(py_TValue) == 16, "sizeof(py_TValue) != 16");
|
||||
static_assert(offsetof(py_TValue, extra) == 4, "offsetof(py_TValue, extra) != 4");
|
@ -22,6 +22,11 @@ void py_initialize() {
|
||||
bool is_little_endian = *(char*)&x == 1;
|
||||
if(!is_little_endian) c11__abort("is_little_endian != true");
|
||||
|
||||
// check py_TValue; 16 bytes to make py_arg() macro work
|
||||
static_assert(sizeof(py_CFunction) <= 8, "sizeof(py_CFunction) > 8");
|
||||
static_assert(sizeof(py_TValue) == 16, "sizeof(py_TValue) != 16");
|
||||
static_assert(offsetof(py_TValue, extra) == 4, "offsetof(py_TValue, extra) != 4");
|
||||
|
||||
MemoryPools__initialize();
|
||||
py_Name__initialize();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user