Compare commits

...

2 Commits

Author SHA1 Message Date
blueloveTH
7394683eaa Update CMakeLists.txt 2025-07-05 16:26:56 +08:00
blueloveTH
418f50c29a make PK_ENABLE_OS control socket 2025-07-05 16:20:15 +08:00
3 changed files with 11 additions and 1 deletions

View File

@ -5,7 +5,6 @@ project(pocketpy)
set(CMAKE_C_STANDARD 11)
set(CMAKE_C_STANDARD_REQUIRED ON)
include(FetchContent)
include(CMakeOptions.txt)
if(WIN32)
@ -78,6 +77,8 @@ endif()
if(PK_ENABLE_MIMALLOC)
message(">> Fetching mimalloc")
include(FetchContent)
FetchContent_Declare(
mimalloc
GIT_REPOSITORY https://github.com/microsoft/mimalloc.git

View File

@ -1,7 +1,10 @@
#pragma once
#include "pocketpy/config.h"
#include <stdint.h>
#if PK_ENABLE_OS
typedef void* c11_socket_handler;
enum c11_address_family { C11_AF_INET = 2 };
@ -23,3 +26,5 @@ int c11_socket_close(c11_socket_handler socket);
int c11_socket_set_block(c11_socket_handler socket, int flag);
c11_socket_handler c11_socket_invalid_socket_handler();
int c11_socket_get_last_error();
#endif // PK_ENABLE_OS

View File

@ -1,5 +1,7 @@
#include "pocketpy/common/socket.h"
#if PK_ENABLE_OS
#include <stddef.h>
#if defined (_WIN32) || defined (_WIN64)
@ -120,3 +122,5 @@ int c11_socket_get_last_error(){
#undef SOCKET_HANDLERTOFD
#undef SOCKET_FDTOHANDLER
#endif // PK_ENABLE_OS