diff --git a/include/pocketpy/common/socket.h b/include/pocketpy/common/socket.h index 87e21974..ff98c2cc 100644 --- a/include/pocketpy/common/socket.h +++ b/include/pocketpy/common/socket.h @@ -1,7 +1,10 @@ #pragma once +#include "pocketpy/config.h" #include +#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 \ No newline at end of file diff --git a/src/common/socket.c b/src/common/socket.c index 17ebcbdc..8f1ac18d 100644 --- a/src/common/socket.c +++ b/src/common/socket.c @@ -1,5 +1,7 @@ #include "pocketpy/common/socket.h" +#if PK_ENABLE_OS + #include #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 \ No newline at end of file