Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Haiku support #32

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 9 additions & 3 deletions lib/kpty.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

#include <QtDebug>

#if defined(__FreeBSD__) || defined(__DragonFly__)
#if defined(__FreeBSD__) || defined(__DragonFly__) || defined(__HAIKU__)
#define HAVE_LOGIN
#define HAVE_LIBUTIL_H
#endif
Expand Down Expand Up @@ -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 <utempter.h>
}
# endif
#else
# include <utmp.h>
# ifdef HAVE_UTMPX
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand Down
1 change: 1 addition & 0 deletions qmltermwidget.pro
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down