aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKazuki Yamaguchi <k@rhe.jp>2017-04-14 10:41:46 +0900
committerKazuki Yamaguchi <k@rhe.jp>2017-09-09 16:32:30 +0900
commitf3ea2d159107055864962f94d1fcbbadec8e82b3 (patch)
tree017fa7f4b91c5ddf07502fef9c715b1c9801e882
parent6fa1efafb28e0a49b5732052f3fe778c80acad2c (diff)
downloadruby-f3ea2d159107055864962f94d1fcbbadec8e82b3.tar.gz
configure.in: assume limits.h is always available
It's a mandatory header in C89.
-rw-r--r--configure.in1
-rw-r--r--include/ruby/ruby.h19
-rw-r--r--include/ruby/st.h8
-rw-r--r--vsnprintf.c13
-rw-r--r--win32/Makefile.sub1
5 files changed, 3 insertions, 39 deletions
diff --git a/configure.in b/configure.in
index b5fed4c612..9c6d5c17fb 100644
--- a/configure.in
+++ b/configure.in
@@ -1389,7 +1389,6 @@ AC_CHECK_HEADERS(fcntl.h)
AC_CHECK_HEADERS(ieeefp.h)
AC_CHECK_HEADERS(intrinsics.h)
AC_CHECK_HEADERS(langinfo.h)
-AC_CHECK_HEADERS(limits.h)
AC_CHECK_HEADERS(locale.h)
AC_CHECK_HEADERS(malloc.h)
AC_CHECK_HEADERS(malloc/malloc.h)
diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h
index 099bbd31d3..58ec783c2e 100644
--- a/include/ruby/ruby.h
+++ b/include/ruby/ruby.h
@@ -179,24 +179,7 @@ typedef char ruby_check_sizeof_voidp[SIZEOF_VOIDP == sizeof(void*) ? 1 : -1];
#define PRIxSIZE PRI_SIZE_PREFIX"x"
#define PRIXSIZE PRI_SIZE_PREFIX"X"
-#ifdef __STDC__
-# include <limits.h>
-#else
-# ifndef LONG_MAX
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
- /* assuming 32bit(2's complement) long */
-# define LONG_MAX 2147483647
-# endif
-# endif
-# ifndef LONG_MIN
-# define LONG_MIN (-LONG_MAX-1)
-# endif
-# ifndef CHAR_BIT
-# define CHAR_BIT 8
-# endif
-#endif
+#include <limits.h>
#ifdef HAVE_LONG_LONG
# ifndef LLONG_MAX
diff --git a/include/ruby/st.h b/include/ruby/st.h
index 47e14a3e2c..dd693a67b3 100644
--- a/include/ruby/st.h
+++ b/include/ruby/st.h
@@ -27,13 +27,7 @@ typedef unsigned LONG_LONG st_data_t;
#endif
#define ST_DATA_T_DEFINED
-#ifndef CHAR_BIT
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
-# define CHAR_BIT 8
-# endif
-#endif
+#include <limits.h>
#ifndef _
# define _(args) args
#endif
diff --git a/vsnprintf.c b/vsnprintf.c
index 78d09c3729..070119f49f 100644
--- a/vsnprintf.c
+++ b/vsnprintf.c
@@ -74,18 +74,7 @@
#define _BSD_VA_LIST_ va_list
#endif
-#ifdef __STDC__
-# include <limits.h>
-#else
-# ifndef LONG_MAX
-# ifdef HAVE_LIMITS_H
-# include <limits.h>
-# else
- /* assuming 32bit(2's complement) long */
-# define LONG_MAX 2147483647
-# endif
-# endif
-#endif
+#include <limits.h>
#if defined(__hpux) && !defined(__GNUC__) && !defined(__STDC__)
#define const
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 4adca6bcbc..147a6171a3 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -633,7 +633,6 @@ $(CONFIG_H): $(MKFILES) $(srcdir)/win32/Makefile.sub $(win_srcdir)/Makefile.sub
!endif
#define RUBY_EXTERN extern __declspec(dllimport)
#define HAVE_DECL_SYS_NERR 1
-#define HAVE_LIMITS_H 1
#define HAVE_FCNTL_H 1
#define HAVE_SYS_UTIME_H 1
#define HAVE_TIME_H 1