diff -ur dvi2tty-5.3.4.orig/disdvi.c dvi2tty-5.3.4/disdvi.c
--- dvi2tty-5.3.4.orig/disdvi.c	2012-06-22 09:12:43.000000000 +0200
+++ dvi2tty-5.3.4/disdvi.c	2013-06-28 15:02:13.000000000 +0200
@@ -45,6 +45,12 @@
  * Include files
  */
 
+#if defined(KPATHSEA)
+# define NO_DEBUG 1
+# include <kpathsea/config.h>
+# include <kpathsea/lib.h>
+#endif
+
 #include <stdio.h>
 #include <stdlib.h>
 #if defined(MSDOS) || defined(WIN32)
@@ -61,12 +67,6 @@
 # include "macintosh.h"
 #endif
 
-#if defined(KPATHSEA)
-# define NO_DEBUG 1
-# include <kpathsea/config.h>
-# include <kpathsea/lib.h>
-#endif
-
 
 /*
  * Constant definitions
diff -ur dvi2tty-5.3.4.orig/dvi2tty.h dvi2tty-5.3.4/dvi2tty.h
--- dvi2tty-5.3.4.orig/dvi2tty.h	2012-06-22 09:09:35.000000000 +0200
+++ dvi2tty-5.3.4/dvi2tty.h	2013-06-28 15:02:13.000000000 +0200
@@ -25,17 +25,6 @@
 Copyright (C) 1989-2010 M.J.E. Mol, MESA Consulting B.V."
 
 
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-#if defined(MSDOS) || (defined(WIN32) && !defined(__MINGW32__))
-# include <malloc.h>
-#else
-# if !defined(THINK_C)
-#  include <unistd.h>
-# endif
-#endif
-
 #if defined(KPATHSEA)
 # define NO_DEBUG 1
 # include <kpathsea/config.h>
@@ -47,6 +36,17 @@
 # define FALSE       0
 #endif
 
+#include <stdio.h>
+#include <string.h>
+#include <stdlib.h>
+#if defined(MSDOS) || (defined(WIN32) && !defined(__MINGW32__))
+# include <malloc.h>
+#else
+# if !defined(THINK_C)
+#  include <unistd.h>
+# endif
+#endif
+
 #define nil         NULL
 
 /*
