зеркало из https://github.com/github/ruby.git
internal.h: rb_fstring_lit
* internal.h (rb_fstring_lit): new macro to make a fstring from a string literal. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@51008 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
Родитель
ca87ac691b
Коммит
0161f79a12
|
@ -1,4 +1,7 @@
|
|||
Wed Jun 24 12:47:05 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
Wed Jun 24 12:47:14 2015 Nobuyoshi Nakada <nobu@ruby-lang.org>
|
||||
|
||||
* internal.h (rb_fstring_lit): new macro to make a fstring from a
|
||||
string literal.
|
||||
|
||||
* include/ruby/intern.h (rb_strlen_lit): new macro to get the
|
||||
length of a string literal, borrowed from mruby/mruby@e4afd53.
|
||||
|
|
2
gc.c
2
gc.c
|
@ -9192,7 +9192,7 @@ Init_GC(void)
|
|||
{
|
||||
VALUE opts;
|
||||
rb_define_const(rb_mGC, "OPTS", opts = rb_ary_new());
|
||||
#define OPT(o) if (o) rb_ary_push(opts, rb_fstring_new(#o, strlen(#o)))
|
||||
#define OPT(o) if (o) rb_ary_push(opts, rb_fstring_lit(#o))
|
||||
OPT(GC_DEBUG);
|
||||
OPT(USE_RGENGC);
|
||||
OPT(RGENGC_DEBUG);
|
||||
|
|
|
@ -1089,6 +1089,8 @@ size_t rb_strftime(char *s, size_t maxsize, const char *format, rb_encoding *enc
|
|||
void Init_frozen_strings(void);
|
||||
VALUE rb_fstring(VALUE);
|
||||
VALUE rb_fstring_new(const char *ptr, long len);
|
||||
#define rb_fstring_lit(str) rb_fstring_new((str), rb_strlen_lit(str))
|
||||
#define rb_fstring_literal(str) rb_fstring_lit(str)
|
||||
int rb_str_buf_cat_escaped_char(VALUE result, unsigned int c, int unicode_p);
|
||||
int rb_str_symname_p(VALUE);
|
||||
VALUE rb_str_quote_unprintable(VALUE);
|
||||
|
|
Загрузка…
Ссылка в новой задаче