summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-18 14:51:08 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-09-18 14:51:08 +0000
commit1495c2f8e9ddaae20665926506705c69231e5b38 (patch)
tree6ab524ad75c135e898bdbb27ba7f77cb3cff2a8f /include
parentc825eee9ea12cb3557dbba37ef78672265c0bdc3 (diff)
string.c: UTF-8 string function
* string.c (rb_utf8_str_new, rb_utf8_str_new_cstr): make UTF-8 string. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47625 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'include')
-rw-r--r--include/ruby/intern.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/include/ruby/intern.h b/include/ruby/intern.h
index f985853..1517023 100644
--- a/include/ruby/intern.h
+++ b/include/ruby/intern.h
@@ -707,6 +707,8 @@ VALUE rb_str_buf_new2(const char*);
VALUE rb_str_tmp_new(long);
VALUE rb_usascii_str_new(const char*, long);
VALUE rb_usascii_str_new_cstr(const char*);
+VALUE rb_utf8_str_new(const char*, long);
+VALUE rb_utf8_str_new_cstr(const char*);
void rb_str_free(VALUE);
void rb_str_shared_replace(VALUE, VALUE);
VALUE rb_str_buf_append(VALUE, VALUE);
@@ -787,6 +789,12 @@ VALUE rb_str_scrub(VALUE, VALUE);
rb_usascii_str_new((str), (long)strlen(str)) : \
rb_usascii_str_new_cstr(str); \
})
+#define rb_utf8_str_new_cstr(str) __extension__ ( \
+{ \
+ (__builtin_constant_p(str)) ? \
+ rb_utf8_str_new((str), (long)strlen(str)) : \
+ rb_utf8_str_new_cstr(str); \
+})
#define rb_external_str_new_cstr(str) __extension__ ( \
{ \
(__builtin_constant_p(str)) ? \