diff --git mc-4.8.13/lib/tty/tty-ncurses.c mc-4.8.13-haiku/lib/tty/tty-ncurses.c
--- mc-4.8.13/lib/tty/tty-ncurses.c
+++ mc-4.8.13-haiku/lib/tty/tty-ncurses.c
@@ -66,7 +66,7 @@
 
 /*** file scope macro definitions ****************************************************************/
 
-#if defined(_AIX) && !defined(CTRL)
+#if !defined(CTRL)
 #define CTRL(x) ((x) & 0x1f)
 #endif

diff --git mc-4.8.13/lib/tty/tty-slang.h mc-4.8.13-haiku/lib/tty/tty-slang.h
--- mc-4.8.13/lib/tty/tty-slang.h
+++ mc-4.8.13-haiku/lib/tty/tty-slang.h
@@ -1,6 +1,7 @@
 
 #ifndef MC__TTY_SLANG_H
 #define MC__TTY_SLANG_H
+#define REAL_UNIX_SYSTEM
 
 #ifdef HAVE_SLANG_SLANG_H
 #include <slang/slang.h>
--- mc-4.8.13/lib/mcconfig/paths.c	2014-09-06 19:04:12.000000000 +0400
+++ mc-4.8.13-haiku/lib/mcconfig/paths.c	2014-09-06 19:07:53.861143040 +0400
@@ -286,7 +286,8 @@
 mc_config_init_config_paths (GError ** mcerror)
 {
     char *dir;
-
+	char *defined_userconf_dir;
+
     mc_return_if_error (mcerror);
 
     if (xdg_vars_initialized)
@@ -345,7 +346,6 @@
 
     mc_config_fix_migrated_rules ();
 #else /* MC_HOMEDIR_XDG */
-    char *defined_userconf_dir;
 
     defined_userconf_dir = tilde_expand (MC_USERCONF_DIR);
     if (g_path_is_absolute (defined_userconf_dir))
--- mc-4.8.13/src/filemanager/ext.c.dist	2014-09-06 19:15:37.899940352 +0400
+++ mc-4.8.13-haiku/src/filemanager/ext.c	2014-09-06 19:14:42.802422784 +0400
@@ -36,6 +36,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <string.h>
+#include <strings.h>
 #include <unistd.h>
 
 #include "lib/global.h"
