From 176329a96c16bf0508724fb05c1b3f8d6d6eab80 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Nov 2014 16:48:13 +0000
Subject: Haiku patch


diff --git a/configure.ac b/configure.ac
index 8524d41..cbef26d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -78,7 +78,7 @@ AM_CONDITIONAL(ENABLE_EXAMPLES, [test "$enable_examples" = "yes"])
 AC_HEADER_DIRENT
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdlib.h string.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h termcap.h])
+AC_CHECK_HEADERS([fcntl.h limits.h malloc.h stdint.h stdlib.h string.h sys/errno.h errno.h sys/ioctl.h sys/param.h unistd.h curses.h ncurses.h sys/cdefs.h langinfo.h])
 
 AC_CHECK_HEADER([termios.h], [], [AC_MSG_ERROR([termios.h is required!])],[])
 
diff --git a/src/editline/readline.h b/src/editline/readline.h
index 932febb..08650d6 100644
--- a/src/editline/readline.h
+++ b/src/editline/readline.h
@@ -75,7 +75,7 @@ typedef KEYMAP_ENTRY *Keymap;
 
 #ifndef CTRL
 #include <sys/ioctl.h>
-#if !defined(__sun) && !defined(__hpux) && !defined(_AIX)
+#if !defined(__sun) && !defined(__hpux) && !defined(_AIX) && !defined(__HAIKU__)
 #include <sys/ttydefaults.h>
 #endif
 #ifndef CTRL
diff --git a/src/vis.c b/src/vis.c
index d67f551..592f4a1 100644
--- a/src/vis.c
+++ b/src/vis.c
@@ -75,6 +75,10 @@ __FBSDID("$FreeBSD$");
 #include <wchar.h>
 #include <wctype.h>
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #ifdef __weak_alias
 __weak_alias(strvisx,_strvisx)
 #endif
-- 
1.8.3.4


From f02342663ecd194b8e8811bf074014bd02e20836 Mon Sep 17 00:00:00 2001
From: Jerome Duval <jerome.duval@gmail.com>
Date: Wed, 26 Nov 2014 16:55:47 +0000
Subject: define NBBY


diff --git a/src/sys.h b/src/sys.h
index 25b14bb..5425e3a 100644
--- a/src/sys.h
+++ b/src/sys.h
@@ -139,4 +139,8 @@ extern char* tgoto(const char*, int, int);
 extern char* tgetstr(char*, char**);
 #endif
 
+#ifdef __HAIKU__
+#define NBBY	8
+#endif
+
 #endif /* _h_sys */
-- 
1.8.3.4

