Compare commits

...

2 Commits

Author SHA1 Message Date
blueloveTH
2a9117f39d Update CMakeLists.txt 2025-09-28 15:43:42 +08:00
blueloveTH
9955a70c74 fix compat warning 2025-09-28 15:31:31 +08:00
2 changed files with 4 additions and 3 deletions

View File

@ -34,9 +34,10 @@ else()
add_definitions(-DNDEBUG) add_definitions(-DNDEBUG)
endif() endif()
# disable -Wshorten-64-to-32 for apple
if(APPLE) if(APPLE)
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32") set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-shorten-64-to-32")
else()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wno-pointer-to-int-cast -Wno-int-to-pointer-cast")
endif() endif()
if(PK_ENABLE_DETERMINISM) if(PK_ENABLE_DETERMINISM)

View File

@ -29,8 +29,8 @@ void py_initialize() {
bool is_little_endian = *(char*)&x == 1; bool is_little_endian = *(char*)&x == 1;
if(!is_little_endian) c11__abort("is_little_endian != true"); if(!is_little_endian) c11__abort("is_little_endian != true");
static_assert(sizeof(py_TValue) == 24, "sizeof(py_TValue) != 24"); _Static_assert(sizeof(py_TValue) == 24, "sizeof(py_TValue) != 24");
static_assert(offsetof(py_TValue, extra) == 4, "offsetof(py_TValue, extra) != 4"); _Static_assert(offsetof(py_TValue, extra) == 4, "offsetof(py_TValue, extra) != 4");
pk_current_vm = pk_all_vm[0] = &pk_default_vm; pk_current_vm = pk_all_vm[0] = &pk_default_vm;