Fixed compile error for Alpine/musl. (0.26.6)
This commit is contained in:
parent
aa55ac85da
commit
6d9b082945
9 changed files with 8 additions and 56 deletions
|
|
@ -1,5 +1,5 @@
|
||||||
cmake_minimum_required(VERSION 3.16)
|
cmake_minimum_required(VERSION 3.16)
|
||||||
project(fun VERSION 0.26.5 LANGUAGES C)
|
project(fun VERSION 0.26.6 LANGUAGES C)
|
||||||
|
|
||||||
set(CMAKE_C_STANDARD 99)
|
set(CMAKE_C_STANDARD 99)
|
||||||
set(CMAKE_C_STANDARD_REQUIRED ON)
|
set(CMAKE_C_STANDARD_REQUIRED ON)
|
||||||
|
|
|
||||||
7
src/vm.c
7
src/vm.c
|
|
@ -21,6 +21,13 @@
|
||||||
|
|
||||||
#ifdef __unix__
|
#ifdef __unix__
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/socket.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
#include <netdb.h>
|
||||||
|
#include <sys/un.h>
|
||||||
|
#include <unistd.h>
|
||||||
|
#include <arpa/inet.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Threading internals (registry and platform glue) */
|
/* Threading internals (registry and platform glue) */
|
||||||
|
|
|
||||||
|
|
@ -9,10 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_CLOSE: {
|
case OP_SOCK_CLOSE: {
|
||||||
/* Pops fd; returns 1/0 */
|
/* Pops fd; returns 1/0 */
|
||||||
Value fdv = pop_value(vm);
|
Value fdv = pop_value(vm);
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_RECV: {
|
case OP_SOCK_RECV: {
|
||||||
/* Pops maxlen, fd; pushes data string ("" on EOF/error) */
|
/* Pops maxlen, fd; pushes data string ("" on EOF/error) */
|
||||||
Value maxv = pop_value(vm);
|
Value maxv = pop_value(vm);
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_SEND: {
|
case OP_SOCK_SEND: {
|
||||||
/* Pops data string, fd; pushes bytes sent (>=0) or -1 */
|
/* Pops data string, fd; pushes bytes sent (>=0) or -1 */
|
||||||
Value datav = pop_value(vm);
|
Value datav = pop_value(vm);
|
||||||
|
|
|
||||||
|
|
@ -9,12 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_TCP_ACCEPT: {
|
case OP_SOCK_TCP_ACCEPT: {
|
||||||
/* Pops listen fd; pushes client fd (>0) or 0 */
|
/* Pops listen fd; pushes client fd (>0) or 0 */
|
||||||
Value fdv = pop_value(vm);
|
Value fdv = pop_value(vm);
|
||||||
|
|
|
||||||
|
|
@ -9,16 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netdb.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_TCP_CONNECT: {
|
case OP_SOCK_TCP_CONNECT: {
|
||||||
/* Pops port, host; pushes fd (>0) or 0 */
|
/* Pops port, host; pushes fd (>0) or 0 */
|
||||||
Value portv = pop_value(vm);
|
Value portv = pop_value(vm);
|
||||||
|
|
|
||||||
|
|
@ -9,17 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <stdlib.h>
|
|
||||||
#include <string.h>
|
|
||||||
#include <stdio.h>
|
|
||||||
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_TCP_LISTEN: {
|
case OP_SOCK_TCP_LISTEN: {
|
||||||
/* Pops backlog, port; pushes listen fd (>0) or 0 */
|
/* Pops backlog, port; pushes listen fd (>0) or 0 */
|
||||||
Value backlogv = pop_value(vm);
|
Value backlogv = pop_value(vm);
|
||||||
|
|
|
||||||
|
|
@ -9,14 +9,6 @@
|
||||||
* Added: 2025-10-04
|
* Added: 2025-10-04
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <string.h>
|
|
||||||
#ifdef __unix__
|
|
||||||
#include <sys/types.h>
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#include <sys/un.h>
|
|
||||||
#include <unistd.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
case OP_SOCK_UNIX_LISTEN: {
|
case OP_SOCK_UNIX_LISTEN: {
|
||||||
/* Pops backlog, path; returns listen fd (>0) or 0 */
|
/* Pops backlog, path; returns listen fd (>0) or 0 */
|
||||||
Value backlogv = pop_value(vm);
|
Value backlogv = pop_value(vm);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue