diff --git a/ChangeLog b/ChangeLog index 04c6564b58..1ef698b609 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +Tue Jun 10 12:43:19 2008 Nobuyoshi Nakada + + * include/ruby/ruby.h (CONST_ID_CACHE): fixed statement expression. + Tue Jun 10 11:25:15 2008 Nobuyoshi Nakada * ruby.c (rb_argv0): revised for ext/tk. diff --git a/include/ruby/ruby.h b/include/ruby/ruby.h index d51718023d..799fc1e712 100644 --- a/include/ruby/ruby.h +++ b/include/ruby/ruby.h @@ -765,20 +765,20 @@ ID rb_to_id(VALUE); VALUE rb_id2str(ID); #define CONST_ID_CACHE(result, str) \ - ({ \ + { \ static ID rb_intern_id_cache; \ if (!rb_intern_id_cache) \ rb_intern_id_cache = (rb_intern)(str); \ result rb_intern_id_cache; \ - }) + } #define CONST_ID(var, str) \ - do {CONST_ID_CACHE(var =, str);} while (0) + do CONST_ID_CACHE(var =, str) while (0) #ifdef __GNUC__ /* __builtin_constant_p and statement expression is available * since gcc-2.7.2.3 at least. */ #define rb_intern(str) \ (__builtin_constant_p(str) ? \ - CONST_ID_CACHE(/**/, str) : \ + (CONST_ID_CACHE(/**/, str)) : \ rb_intern(str)) #endif