From c4b2d70535d83d7de3a155466a03767e74b9d5d8 Mon Sep 17 00:00:00 2001 From: Vasily Levchenko Date: Fri, 29 Sep 2017 14:59:38 +0300 Subject: [PATCH] [platform lib][linux][posix] config to build samples --- klib/src/platform/linux/posix.def | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/klib/src/platform/linux/posix.def b/klib/src/platform/linux/posix.def index 922b2c0bd8d..32f9a45f48e 100644 --- a/klib/src/platform/linux/posix.def +++ b/klib/src/platform/linux/posix.def @@ -12,7 +12,7 @@ headers = alloca.h ar.h assert.h complex.h dirent.h dlfcn.h err.h errno.h fcntl. sys/queue.h sys/select.h sys/shm.h sys/stat.h \ limits.h sys/time.h sys/times.h sys/wait.h -compilerOpts = -D_GNU_SOURCE +compilerOpts = -D_ANSI_SOURCE -D_POSIX_SOURCE -D_BSD_SOURCE -D_XOPEN_SOURCE=700 --- // cinterop -target linux -def klib/src/platform/linux/posix.def -o platform.posix.klib @@ -26,3 +26,19 @@ static int posix_errno() { static int posix_h_errno() { return h_errno; } + +static short posix_htons(short x) { + return htons(x); +} + +static void posix_FD_ZERO(fd_set *set) { + FD_ZERO(set); +} + +static void posix_FD_SET(int bit, fd_set *set) { + FD_SET(bit, set); +} + +static int posix_FD_ISSET(int bit, fd_set *set) { + return FD_ISSET(bit, set); +} \ No newline at end of file