+2010-08-06 Jan Djärv <jan.h.d@swipnet.se>
+
+ * sysdep.c: Move include term.h last of includes (Bug#6812).
+
2010-08-06 Eli Zaretskii <eliz@gnu.org>
* dispnew.c (realloc_glyph_pool): Zero out newly allocated glyphs.
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef HAVE_TERM_H
-#include <term.h>
-#endif
#include "lisp.h"
/* Including stdlib.h isn't necessarily enough to get srandom
#include "dispextern.h"
#include "process.h"
#include "cm.h" /* for reset_sys_modes */
+#ifdef HAVE_TERM_H
+/* Include this last. If it is ncurses header file, it adds a lot of
+ defines that interfere with stuff in other headers. Someone responsible
+ for ncurses messed up bigtime. See bug#6812. */
+#include <term.h>
+#endif
/* For serial_configure and serial_open. */
extern Lisp_Object QCport, QCspeed, QCprocess;