зеркало из https://github.com/github/ruby.git
* include/ruby/ruby.h (SSIZET2NUM, NUM2SSIZET, SSIZE_MAX, SSIZE_MIN):
macros for ssize_t. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@18651 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
a55e167b68
Коммит
38280af483
|
@ -1,3 +1,8 @@
|
|||
Sat Aug 16 08:52:55 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/ruby.h (SSIZET2NUM, NUM2SSIZET, SSIZE_MAX, SSIZE_MIN):
|
||||
macros for ssize_t.
|
||||
|
||||
Sat Aug 16 08:11:04 2008 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* transcode_data.h (rb_transcoder_stateful_type_t): defined.
|
||||
|
|
|
@ -210,10 +210,28 @@ VALUE rb_ull2inum(unsigned LONG_LONG);
|
|||
|
||||
#if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
|
||||
# define SIZET2NUM(v) ULL2NUM(v)
|
||||
# define SSIZET2NUM(v) LL2NUM(v)
|
||||
#elif SIZEOF_SIZE_T == SIZEOF_LONG
|
||||
# define SIZET2NUM(v) ULONG2NUM(v)
|
||||
# define SSIZET2NUM(v) LONG2NUM(v)
|
||||
#else
|
||||
# define SIZET2NUM(v) UINT2NUM(v)
|
||||
# define SSIZET2NUM(v) INT2NUM(v)
|
||||
#endif
|
||||
|
||||
#ifndef SSIZE_MAX
|
||||
# if SIZEOF_SIZE_T > SIZEOF_LONG && defined(HAVE_LONG_LONG)
|
||||
# define SSIZE_MAX LLONG_MAX
|
||||
# define SSIZE_MIN LLONG_MIN
|
||||
# elif SIZEOF_SIZE_T == SIZEOF_LONG
|
||||
# define SSIZE_MAX LONG_MAX
|
||||
# define SSIZE_MIN LONG_MIN
|
||||
# elif SIZEOF_SIZE_T == SIZEOF_INT
|
||||
# define SSIZE_MAX INT_MAX
|
||||
# define SSIZE_MIN INT_MIN
|
||||
# else
|
||||
# define SSIZE_MAX SHRT_MAX
|
||||
# define SSIZE_MIN SHRT_MIN
|
||||
#endif
|
||||
|
||||
#ifndef PIDT2NUM
|
||||
|
@ -411,8 +429,10 @@ unsigned LONG_LONG rb_num2ull(VALUE);
|
|||
|
||||
#if defined(HAVE_LONG_LONG) && SIZEOF_SIZE_T > SIZEOF_LONG
|
||||
# define NUM2SIZET(x) ((size_t)NUM2ULL(x))
|
||||
# define NUM2SSIZET(x) ((size_t)NUM2LL(x))
|
||||
#else
|
||||
# define NUM2SIZET(x) NUM2ULONG(x)
|
||||
# define NUM2SSIZET(x) NUM2LONG(x)
|
||||
#endif
|
||||
|
||||
double rb_num2dbl(VALUE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче