mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
intern.h: rb_str_new_literal
* include/ruby/intern.h (rb_str_new_literal): define on all platforms, not only gcc. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
7a6934f3a8
commit
e396ba84fb
2 changed files with 10 additions and 4 deletions
|
@ -1,3 +1,8 @@
|
|||
Sat Jan 3 19:52:12 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* include/ruby/intern.h (rb_str_new_literal): define on all
|
||||
platforms, not only gcc.
|
||||
|
||||
Sat Jan 3 18:53:28 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* ext/fiddle/lib/fiddle/cparser.rb (parse_ctype): limit split word
|
||||
|
|
|
@ -832,10 +832,6 @@ VALUE rb_str_scrub(VALUE, VALUE);
|
|||
rb_utf8_str_new_static((str), (long)strlen(str)) : \
|
||||
rb_utf8_str_new_cstr(str); \
|
||||
})
|
||||
#define rb_str_new_literal(str) rb_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_usascii_str_new_literal(str) rb_usascii_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_utf8_str_new_literal(str) rb_utf8_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_static((str), sizeof(str)-1, (enc))
|
||||
#define rb_external_str_new_cstr(str) __extension__ ( \
|
||||
{ \
|
||||
(__builtin_constant_p(str)) ? \
|
||||
|
@ -878,6 +874,11 @@ VALUE rb_str_scrub(VALUE, VALUE);
|
|||
#define rb_str_buf_cat rb_str_cat
|
||||
#define rb_str_buf_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_usascii_str_new_literal(str) rb_usascii_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_utf8_str_new_literal(str) rb_utf8_str_new_static((str), sizeof(str)-1)
|
||||
#define rb_enc_str_new_literal(str, enc) rb_enc_str_new_static((str), sizeof(str)-1, (enc))
|
||||
|
||||
/* struct.c */
|
||||
VALUE rb_struct_new(VALUE, ...);
|
||||
VALUE rb_struct_define(const char*, ...);
|
||||
|
|
Loading…
Reference in a new issue