1
0
Fork 0
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:
akr 2013-07-29 23:22:25 +00:00
parent 9f06167a26
commit 106b0ce31b
2 changed files with 17 additions and 13 deletions

View file

@ -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> Mon Jul 29 22:55:26 2013 Nobuyoshi Nakada <nobu@ruby-lang.org>
* sizes.c (Init_sizes): define RbConfig::SIZEOF. [Feature #8568] * sizes.c (Init_sizes): define RbConfig::SIZEOF. [Feature #8568]

26
sizes.c
View file

@ -8,43 +8,43 @@ Init_sizes(void)
#define DEFINE(type, size) rb_hash_aset(s, rb_str_new_cstr(#type), INT2FIX(SIZEOF_##size)); #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); DEFINE(int, INT);
#endif #endif
#ifdef SIZEOF_SHORT #if SIZEOF_SHORT != 0
DEFINE(short, SHORT); DEFINE(short, SHORT);
#endif #endif
#ifdef SIZEOF_LONG #if SIZEOF_LONG != 0
DEFINE(long, LONG); DEFINE(long, LONG);
#endif #endif
#ifdef SIZEOF_LONG_LONG #if SIZEOF_LONG_LONG != 0 && defined(HAVE_TRUE_LONG_LONG)
DEFINE(long long, LONG_LONG); DEFINE(long long, LONG_LONG);
#endif #endif
#ifdef SIZEOF___INT64 #if SIZEOF___INT64 != 0
DEFINE(__int64, __INT64); DEFINE(__int64, __INT64);
#endif #endif
#ifdef SIZEOF___INT128 #if SIZEOF___INT128 != 0
DEFINE(__int128, __INT128); DEFINE(__int128, __INT128);
#endif #endif
#ifdef SIZEOF_OFF_T #if SIZEOF_OFF_T != 0
DEFINE(off_t, OFF_T); DEFINE(off_t, OFF_T);
#endif #endif
#ifdef SIZEOF_VOIDP #if SIZEOF_VOIDP != 0
DEFINE(void*, VOIDP); DEFINE(void*, VOIDP);
#endif #endif
#ifdef SIZEOF_FLOAT #if SIZEOF_FLOAT != 0
DEFINE(float, FLOAT); DEFINE(float, FLOAT);
#endif #endif
#ifdef SIZEOF_DOUBLE #if SIZEOF_DOUBLE != 0
DEFINE(double, DOUBLE); DEFINE(double, DOUBLE);
#endif #endif
#ifdef SIZEOF_TIME_T #if SIZEOF_TIME_T != 0
DEFINE(time_t, TIME_T); DEFINE(time_t, TIME_T);
#endif #endif
#ifdef SIZEOF_SIZE_T #if SIZEOF_SIZE_T != 0
DEFINE(size_t, SIZE_T); DEFINE(size_t, SIZE_T);
#endif #endif
#ifdef SIZEOF_PTRDIFF_T #if SIZEOF_PTRDIFF_T != 0
DEFINE(ptrdiff_t, PTRDIFF_T); DEFINE(ptrdiff_t, PTRDIFF_T);
#endif #endif