mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* sizes.c (Init_sizes): Define sizes only if the type actually exists.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42245 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
9f06167a26
commit
106b0ce31b
2 changed files with 17 additions and 13 deletions
|
@ -1,3 +1,7 @@
|
|||
Tue Jul 30 08:19:42 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* sizes.c (Init_sizes): Define sizes only if the type actually exists.
|
||||
|
||||
Mon Jul 29 22:55:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* sizes.c (Init_sizes): define RbConfig::SIZEOF. [Feature #8568]
|
||||
|
|
26
sizes.c
26
sizes.c
|
@ -8,43 +8,43 @@ Init_sizes(void)
|
|||
|
||||
#define DEFINE(type, size) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size));
|
||||
|
||||
#ifdef SIZEOF_INT
|
||||
#if SIZEOF_INT != 0
|
||||
DEFINE(int, INT);
|
||||
#endif
|
||||
#ifdef SIZEOF_SHORT
|
||||
#if SIZEOF_SHORT != 0
|
||||
DEFINE(short, SHORT);
|
||||
#endif
|
||||
#ifdef SIZEOF_LONG
|
||||
#if SIZEOF_LONG != 0
|
||||
DEFINE(long, LONG);
|
||||
#endif
|
||||
#ifdef SIZEOF_LONG_LONG
|
||||
#if SIZEOF_LONG_LONG != 0 && defined(HAVE_TRUE_LONG_LONG)
|
||||
DEFINE(long long, LONG_LONG);
|
||||
#endif
|
||||
#ifdef SIZEOF___INT64
|
||||
#if SIZEOF___INT64 != 0
|
||||
DEFINE(__int64, __INT64);
|
||||
#endif
|
||||
#ifdef SIZEOF___INT128
|
||||
#if SIZEOF___INT128 != 0
|
||||
DEFINE(__int128, __INT128);
|
||||
#endif
|
||||
#ifdef SIZEOF_OFF_T
|
||||
#if SIZEOF_OFF_T != 0
|
||||
DEFINE(off_t, OFF_T);
|
||||
#endif
|
||||
#ifdef SIZEOF_VOIDP
|
||||
#if SIZEOF_VOIDP != 0
|
||||
DEFINE(void*, VOIDP);
|
||||
#endif
|
||||
#ifdef SIZEOF_FLOAT
|
||||
#if SIZEOF_FLOAT != 0
|
||||
DEFINE(float, FLOAT);
|
||||
#endif
|
||||
#ifdef SIZEOF_DOUBLE
|
||||
#if SIZEOF_DOUBLE != 0
|
||||
DEFINE(double, DOUBLE);
|
||||
#endif
|
||||
#ifdef SIZEOF_TIME_T
|
||||
#if SIZEOF_TIME_T != 0
|
||||
DEFINE(time_t, TIME_T);
|
||||
#endif
|
||||
#ifdef SIZEOF_SIZE_T
|
||||
#if SIZEOF_SIZE_T != 0
|
||||
DEFINE(size_t, SIZE_T);
|
||||
#endif
|
||||
#ifdef SIZEOF_PTRDIFF_T
|
||||
#if SIZEOF_PTRDIFF_T != 0
|
||||
DEFINE(ptrdiff_t, PTRDIFF_T);
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in a new issue