Add portability support for Vinix ##build (#18997)

This commit is contained in:
pancake 2021-08-19 12:25:50 +02:00 committed by GitHub
parent dbf591b529
commit 9525cb90b1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 26 additions and 15 deletions

2
configure vendored
View File

@ -402,7 +402,7 @@ echo "ERROR: ${CC} cannot create executables" >&2 ;
exit 1 ; fi
ochof "checking for dynamic library... "
HAVE_LIB_DL=0
for OS in gnulinux linux gnu/kfreebsd syllable serenityos sunos darwin beos solaris wsl ; do
for OS in gnulinux linux gnu/kfreebsd syllable serenityos vinix sunos darwin beos solaris wsl ; do
if [ "${HOST_OS}" = "${OS}" ]; then
HAVE_LIB_DL=1
break;

View File

@ -157,7 +157,25 @@
# define __UNIX__ 1
#endif
#if defined(EMSCRIPTEN) || defined(__wasi__) || defined(__linux__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__) || defined(__QNX__) || defined(__sun) || defined(__HAIKU__) || defined(__serenity__)
#if 0
// XXX any non-unix system dont have termios :? android?
#if __linux__ || __APPLE__ || __OpenBSD__ || __FreeBSD__ || __NetBSD__ || __DragonFly__ || __HAIKU__ || __serenity__ || __vinix__
#define HAVE_PTY 1
#else
#define HAVE_PTY 0
#endif
#endif
#if EMSCRIPTEN || __wasi__ || defined(__serenity__)
#undef HAVE_PTY
#define HAVE_PTY 0
#else
#define HAVE_PTY __UNIX__ && !__ANDROID__ && LIBC_HAVE_FORK && !__sun
#endif
#if defined(EMSCRIPTEN) || defined(__wasi__) || defined(__linux__) || defined(__APPLE__) || defined(__GNU__) || defined(__ANDROID__) || defined(__QNX__) || defined(__sun) || defined(__HAIKU__) || defined(__serenity__) || defined(__vinix__)
#define __BSD__ 0
#define __UNIX__ 1
#endif

View File

@ -5,11 +5,6 @@
#include <r_util.h>
#include <r_util/r_print.h>
#if __UNIX__
#include <errno.h>
#include <fcntl.h>
#endif
#define USE_OWNTIMER 1
#if USE_OWNTIMER
#include "io_gprobe.h"
@ -26,7 +21,12 @@
#include <windows.h>
#else
#if __linux__ || __APPLE__ || __OpenBSD__ || __FreeBSD__ || __NetBSD__ || __DragonFly__ || __HAIKU__ || __serenity__
#if __UNIX__
#include <errno.h>
#include <fcntl.h>
#endif
#if HAVE_PTY
#include <sys/ioctl.h>
#include <termios.h>
#else

View File

@ -59,13 +59,6 @@
#define pid_t int
#endif
#if EMSCRIPTEN || __wasi__ || defined(__serenity__)
#undef HAVE_PTY
#define HAVE_PTY 0
#else
#define HAVE_PTY __UNIX__ && !__ANDROID__ && LIBC_HAVE_FORK && !__sun
#endif
#if HAVE_PTY
static int (*dyn_openpty)(int *amaster, int *aslave, char *name, struct termios *termp, struct winsize *winp) = NULL;