* template/id.h.tmpl, id.h (ruby_method_ids_check): enclosed in a

struct.


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20978 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2008-12-24 20:53:06 +00:00
parent 934525776f
commit b8db90f35a
3 changed files with 10 additions and 3 deletions

View File

@ -1,8 +1,11 @@
Thu Dec 25 05:05:06 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Dec 25 05:53:01 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* template/id.h.tmpl, id.h (ruby_method_ids): not depend on if * template/id.h.tmpl, id.h (ruby_method_ids): not depend on if
token are defined as macros. [ruby-dev:37553] token are defined as macros. [ruby-dev:37553]
* template/id.h.tmpl, id.h (ruby_method_ids_check): enclosed in a
struct.
Thu Dec 25 01:52:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org> Thu Dec 25 01:52:34 2008 Nobuyoshi Nakada <nobu@ruby-lang.org>
* thread.c (thread_start_func_2): sets native thread key. * thread.c (thread_start_func_2): sets native thread key.

4
id.h
View File

@ -122,8 +122,9 @@ enum ruby_method_ids {
}; };
#ifdef tLAST_TOKEN #ifdef tLAST_TOKEN
struct ruby_method_ids_check {
#define ruby_method_id_check_for(name, value) \ #define ruby_method_id_check_for(name, value) \
typedef int ruby_method_id_check_for_##name[name == value ? 1 : -1] int checking_for_##name[name == value ? 1 : -1]
ruby_method_id_check_for(tUPLUS, 321); ruby_method_id_check_for(tUPLUS, 321);
ruby_method_id_check_for(tUMINUS, 322); ruby_method_id_check_for(tUMINUS, 322);
ruby_method_id_check_for(tPOW, 323); ruby_method_id_check_for(tPOW, 323);
@ -156,6 +157,7 @@ ruby_method_id_check_for(id_core_define_method, 373);
ruby_method_id_check_for(id_core_define_singleton_method, 374); ruby_method_id_check_for(id_core_define_singleton_method, 374);
ruby_method_id_check_for(id_core_set_postexe, 375); ruby_method_id_check_for(id_core_set_postexe, 375);
ruby_method_id_check_for(tLAST_TOKEN, 376); ruby_method_id_check_for(tLAST_TOKEN, 376);
};
#endif #endif
#endif /* RUBY_ID_H */ #endif /* RUBY_ID_H */

View File

@ -115,11 +115,13 @@ enum ruby_method_ids {
}; };
#ifdef tLAST_TOKEN #ifdef tLAST_TOKEN
struct ruby_method_ids_check {
#define ruby_method_id_check_for(name, value) \ #define ruby_method_id_check_for(name, value) \
typedef int ruby_method_id_check_for_##name[name == value ? 1 : -1] int checking_for_##name[name == value ? 1 : -1]
% tokens.map do |token, value| % tokens.map do |token, value|
ruby_method_id_check_for(<%=token%>, <%=value%>); ruby_method_id_check_for(<%=token%>, <%=value%>);
% end % end
};
#endif #endif
#endif /* RUBY_ID_H */ #endif /* RUBY_ID_H */