From f3ea2d159107055864962f94d1fcbbadec8e82b3 Mon Sep 17 00:00:00 2001 From: Kazuki Yamaguchi Date: Fri, 14 Apr 2017 10:41:46 +0900 Subject: configure.in: assume limits.h is always available It's a mandatory header in C89. --- configure.in | 1 - include/ruby/ruby.h | 19 +------------------ include/ruby/st.h | 8 +------- vsnprintf.c | 13 +------------ win32/Makefile.sub | 1 - 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 -#else -# ifndef LONG_MAX -# ifdef HAVE_LIMITS_H -# include -# 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 #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 -# else -# define CHAR_BIT 8 -# endif -#endif +#include #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 -#else -# ifndef LONG_MAX -# ifdef HAVE_LIMITS_H -# include -# else - /* assuming 32bit(2's complement) long */ -# define LONG_MAX 2147483647 -# endif -# endif -#endif +#include #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 -- cgit v1.2.3