From bafe8376581b62e7ce9a87455d376809b7607fdd Mon Sep 17 00:00:00 2001 From: naruse Date: Thu, 27 Oct 2011 00:59:46 +0000 Subject: [PATCH] * include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined. patched by The Written Word Inc. [ruby-core:40422] [Bug #5489] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 5 +++++ include/ruby/ruby.h | 16 ++++++++++++++++ 2 files changed, 21 insertions(+) diff --git a/ChangeLog b/ChangeLog index 6b8abc5129..ed53ba3e5b 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +Thu Oct 27 09:57:56 2011 NARUSE, Yui + + * include/ruby/ruby.h (SIZE_MAX): define SIZE_MAX if not defined. + patched by The Written Word Inc. [ruby-core:40422] [Bug #5489] + Thu Oct 27 08:47:38 2011 Martin Bosslet * ext/psych/parser.c: remove unused variable. diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index 50b20845f1..c9544fa510 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -258,6 +258,22 @@ VALUE rb_ull2inum(unsigned LONG_LONG); # define SSIZET2NUM(v) INT2NUM(v) #endif +#ifndef SIZE_MAX +# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG) +# define SIZE_MAX ULLONG_MAX +# define SIZE_MIN ULLONG_MIN +# elif SIZEOF_SIZE_T == SIZEOF_LONG +# define SIZE_MAX ULONG_MAX +# define SIZE_MIN ULONG_MIN +# elif SIZEOF_SIZE_T == SIZEOF_INT +# define SIZE_MAX UINT_MAX +# define SIZE_MIN UINT_MIN +# else +# define SIZE_MAX USHRT_MAX +# define SIZE_MIN USHRT_MIN +# endif +#endif + #ifndef SSIZE_MAX # if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG) # define SSIZE_MAX LLONG_MAX