diff --git a/lib/kpty.cpp b/lib/kpty.cpp index 5234b5fc..2611d48c 100644 --- a/lib/kpty.cpp +++ b/lib/kpty.cpp @@ -26,7 +26,7 @@ #include -#if defined(__FreeBSD__) || defined(__DragonFly__) +#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__HAIKU__) #define HAVE_LOGIN #define HAVE_LIBUTIL_H #endif @@ -95,9 +95,15 @@ #endif #ifdef HAVE_UTEMPTER +# ifdef __HAIKU__ +/* Haiku doesn't have any of those yet, so we fake the simplest */ +# define addToUtmp(n, h, fd) {} +# define removeLineFromUtmp(n, fd) {} +# else extern "C" { # include } +# endif #else # include # ifdef HAVE_UTMPX @@ -135,7 +141,7 @@ extern "C" { #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__bsdi__) || defined(__APPLE__) || defined (__DragonFly__) # define _tcgetattr(fd, ttmode) ioctl(fd, TIOCGETA, (char *)ttmode) #else -# if defined(_HPUX_SOURCE) || defined(__Lynx__) || defined (__CYGWIN__) || defined(__GNU__) +# if defined(_HPUX_SOURCE) || defined(__Lynx__) || defined (__CYGWIN__) || defined(__GNU__) || defined (__HAIKU__) # define _tcgetattr(fd, ttmode) tcgetattr(fd, ttmode) # else # define _tcgetattr(fd, ttmode) ioctl(fd, TCGETS, (char *)ttmode) @@ -145,7 +151,7 @@ extern "C" { #if defined (__FreeBSD__) || defined(__FreeBSD_kernel__) || defined (__NetBSD__) || defined (__OpenBSD__) || defined (__bsdi__) || defined(__APPLE__) || defined (__DragonFly__) # define _tcsetattr(fd, ttmode) ioctl(fd, TIOCSETA, (char *)ttmode) #else -# if defined(_HPUX_SOURCE) || defined(__CYGWIN__) || defined(__GNU__) +# if defined(_HPUX_SOURCE) || defined(__CYGWIN__) || defined(__GNU__) || defined (__HAIKU__) # define _tcsetattr(fd, ttmode) tcsetattr(fd, TCSANOW, ttmode) # else # define _tcsetattr(fd, ttmode) ioctl(fd, TCSETS, (char *)ttmode) diff --git a/qmltermwidget.pro b/qmltermwidget.pro index c9594a99..af90d646 100644 --- a/qmltermwidget.pro +++ b/qmltermwidget.pro @@ -9,6 +9,7 @@ DESTDIR = $$OUT_PWD/QMLTermWidget DEFINES += HAVE_POSIX_OPENPT HAVE_SYS_TIME_H macx:DEFINES += HAVE_UTMPX _UTMPX_COMPAT HAVE_PTSNAME HAVE_UNLOCKPT HAVE_GRANTPT +haiku:DEFINES += HAVE_PTSNAME GRANTPT HAVE_UTEMPTER INCLUDEPATH += $$PWD/lib DEPENDPATH += $$PWD/lib