From 96dce264019931944e1ef5101c2987d39aad3598 Mon Sep 17 00:00:00 2001
From: David Lawrence Ramsey <pooka109@gmail.com>
Date: Tue, 6 Jun 2006 18:41:58 +0000
Subject: [PATCH] various minor include fixes

git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3627 35c25a1d-7b9e-4130-9fde-d3aeb78583b8
---
 ChangeLog    | 6 ++++++
 configure.ac | 2 +-
 src/nano.c   | 1 -
 src/nano.h   | 4 ++++
 4 files changed, 11 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1ddf4fc0..b73eef78 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -269,6 +269,8 @@ CVS code -
 - nano.h:
 	- Reorder the toggle #defines to match their corresponding order
 	  in toggle_init(). (DLR)
+	- Move the #include for sys/param.h here from nano.c, and add an
+	  #ifdef around it. (DLR)
 - prompt.c:
   get_prompt_string()
 	- Include the handling of the help key even when help is
@@ -383,6 +385,10 @@ CVS code -
 	- Update the last copyright notice to include 2006. (DLR)
 - configure.ac:
 	- Remove old warnings about color support. (DLR)
+	- Remove conditional header checks for fcntl.h and termios.h, as
+	  nano won't build without them, and add conditional header
+	  check for sys/param.h, as some systems need only limits.h.
+	  (DLR)
 - doc/faq.html:
 	- Add a new section 4.4, and move all section 4 entries after it
 	  down one number, to explain how to deal with problems typing
diff --git a/configure.ac b/configure.ac
index ce21a5b3..f5891bb5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -49,7 +49,7 @@ AC_DEFINE_DIR([PKGDATADIR], [pkgdatadir], [Where data are placed to.])
 dnl Checks for header files.
 
 AC_HEADER_STDC
-AC_CHECK_HEADERS(fcntl.h getopt.h libintl.h limits.h regex.h termios.h wchar.h wctype.h)
+AC_CHECK_HEADERS(getopt.h libintl.h limits.h regex.h sys/param.h wchar.h wctype.h)
 
 dnl Checks for options.
 
diff --git a/src/nano.c b/src/nano.c
index dffe8c2f..1345b389 100644
--- a/src/nano.c
+++ b/src/nano.c
@@ -30,7 +30,6 @@
 #include <string.h>
 #include <fcntl.h>
 #include <sys/ioctl.h>
-#include <sys/param.h>
 #include <errno.h>
 #include <ctype.h>
 #include <locale.h>
diff --git a/src/nano.h b/src/nano.h
index 26d6c4ac..b228b4c8 100644
--- a/src/nano.h
+++ b/src/nano.h
@@ -40,6 +40,10 @@
 #include <limits.h>
 #endif
 
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+
 /* Macros for flags. */
 #define SET(bit) flags |= bit
 #define UNSET(bit) flags &= ~bit
-- 
GitLab