* include/ruby/intern.h (rb_strlen_lit): new macro to get the
  length of a string literal, borrowed from mruby/mruby@e4afd53.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51007 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2015-06-24 03:47:10 +00:00
Родитель 7fac69128c
Коммит ca87ac691b
2 изменённых файлов: 14 добавлений и 4 удалений

Просмотреть файл

@ -1,3 +1,8 @@
Wed Jun 24 12:47:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
* include/ruby/intern.h (rb_strlen_lit): new macro to get the
length of a string literal, borrowed from mruby/mruby@e4afd53.
Wed Jun 24 12:21:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org> Wed Jun 24 12:21:16 2015 SHIBATA Hiroshi <hsbt@ruby-lang.org>
* re.c: Update documentation for Regexp class. * re.c: Update documentation for Regexp class.

Просмотреть файл

@ -877,10 +877,15 @@ VALUE rb_sym_all_symbols(void);
#define rb_str_buf_cat rb_str_cat #define rb_str_buf_cat rb_str_cat
#define rb_str_buf_cat2 rb_str_cat_cstr #define rb_str_buf_cat2 rb_str_cat_cstr
#define rb_str_cat2 rb_str_cat_cstr #define rb_str_cat2 rb_str_cat_cstr
#define rb_str_new_literal(str) rb_str_new_static((str), sizeof(str)-1) #define rb_strlen_lit(str) (sizeof(str "") - 1)
#define rb_usascii_str_new_literal(str) rb_usascii_str_new_static((str), sizeof(str)-1) #define rb_str_new_lit(str) rb_str_new_static((str), rb_strlen_lit(str))
#define rb_utf8_str_new_literal(str) rb_utf8_str_new_static((str), sizeof(str)-1) #define rb_usascii_str_new_lit(str) rb_usascii_str_new_static((str), rb_strlen_lit(str))
#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_static((str), sizeof(str)-1, (enc)) #define rb_utf8_str_new_lit(str) rb_utf8_str_new_static((str), rb_strlen_lit(str))
#define rb_enc_str_new_lit(str, enc) rb_enc_str_new_static((str), rb_strlen_lit(str), (enc))
#define rb_str_new_literal(str) rb_str_new_lit(str)
#define rb_usascii_str_new_literal(str) rb_usascii_str_new_lit(str)
#define rb_utf8_str_new_literal(str) rb_utf8_str_new_lit(str)
#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_lit(str, enc)
/* struct.c */ /* struct.c */
VALUE rb_struct_new(VALUE, ...); VALUE rb_struct_new(VALUE, ...);