diff -urN libedit-20120601-3.0/configure.ac libedit-20120601-3.0-haiku/configure.ac
--- libedit-20120601-3.0/configure.ac	2012-06-01 12:04:56.000000000 -0700
+++ libedit-20120601-3.0-haiku/configure.ac	2012-06-16 15:01:10.749207552 -0700
@@ -65,7 +65,7 @@
 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 -urN libedit-20120601-3.0/examples/fileman.c libedit-20120601-3.0-haiku/examples/fileman.c
--- libedit-20120601-3.0/examples/fileman.c	2010-04-22 12:13:17.000000000 -0700
+++ libedit-20120601-3.0-haiku/examples/fileman.c	2012-06-16 15:01:10.911212544 -0700
@@ -11,7 +11,11 @@
 #include <sys/types.h>
 #include <sys/file.h>
 #include <sys/stat.h>
+#ifdef HAVE_SYS_ERRNO_H
 #include <sys/errno.h>
+#elif HAVE_ERRNO_H
+#include <errno.h>
+#endif
 #include <ctype.h>
 #include <string.h>
 #include <stdlib.h>
diff -urN libedit-20120601-3.0/src/editline/readline.h libedit-20120601-3.0-haiku/src/editline/readline.h
--- libedit-20120601-3.0/src/editline/readline.h	2012-05-22 10:43:49.000000000 -0700
+++ libedit-20120601-3.0-haiku/src/editline/readline.h	2012-06-16 15:01:10.947388416 -0700
@@ -75,7 +75,7 @@
 
 #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 -urN libedit-20120601-3.0/src/vis.c libedit-20120601-3.0-haiku/src/vis.c
--- libedit-20120601-3.0/src/vis.c	2011-07-08 23:39:42.000000000 -0700
+++ libedit-20120601-3.0-haiku/src/vis.c	2012-06-16 15:01:11.063176704 -0700
@@ -68,6 +68,10 @@
 #include <errno.h>
 #include <stdlib.h>
 
+#ifdef HAVE_STDINT_H
+#include <stdint.h>
+#endif
+
 #ifdef __weak_alias
 __weak_alias(strvisx,_strvisx)
 #endif
