1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate

values have VALUE type. there is an environment where sizeof(VALUE)
  != sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
  and received by 64bit integer (VALUE), upper bits may have garbage value.
  [ruby-dev:27513]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@9468 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
ocean 2005-10-26 00:05:58 +00:00
parent 458ce150cd
commit 4ce57dd4bc
2 changed files with 12 additions and 4 deletions

View file

@ -1,3 +1,11 @@
Wed Oct 26 09:04:51 2005 Hirokazu Yamamoto <ocean@m2.ccsnet.ne.jp>
* ruby.h (Qfalse, Qtrue, Qnil, Qundef): make sure these immediate
values have VALUE type. there is an environment where sizeof(VALUE)
!= sizeof(int) like IA64. if 32bit integer (Qtrue) is passed to ANYARGS
and received by 64bit integer (VALUE), upper bits may have garbage value.
[ruby-dev:27513]
Wed Oct 26 01:58:19 2005 Nobuyoshi Nakada <nobu@ruby-lang.org>
* configure.in (RUBY_EXTERN): macro to export symbols in shared

8
ruby.h
View file

@ -170,10 +170,10 @@ VALUE rb_ull2inum _((unsigned LONG_LONG));
#define SYM2ID(x) RSHIFT((long)x,8)
/* special contants - i.e. non-zero and non-fixnum constants */
#define Qfalse 0
#define Qtrue 2
#define Qnil 4
#define Qundef 6 /* undefined value for placeholder */
#define Qfalse ((VALUE)0)
#define Qtrue ((VALUE)2)
#define Qnil ((VALUE)4)
#define Qundef ((VALUE)6) /* undefined value for placeholder */
#define RTEST(v) (((VALUE)(v) & ~Qnil) != 0)
#define NIL_P(v) ((VALUE)(v) == Qnil)