From 4f31f5d0a387774377f3090765770d8bf33531f8 Mon Sep 17 00:00:00 2001 From: Takashi Tamura Date: Thu, 23 Feb 2017 21:08:04 +0900 Subject: [PATCH] [ruby] use %fragment to clarify the dependency of code. --- Lib/ruby/rubywstrings.swg | 4 ++-- Lib/ruby/std_wstring.i | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Lib/ruby/rubywstrings.swg b/Lib/ruby/rubywstrings.swg index 93d0da21d..7da6f4bf2 100644 --- a/Lib/ruby/rubywstrings.swg +++ b/Lib/ruby/rubywstrings.swg @@ -4,7 +4,7 @@ * utility methods for wchar_t strings * ------------------------------------------------------------ */ -%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_AsCharPtrAndSize") { +%fragment("SWIG_AsWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_AsCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { SWIGINTERN int SWIG_AsWCharPtrAndSize(VALUE obj, wchar_t **cptr, size_t *psize, int *alloc) { @@ -33,7 +33,7 @@ SWIG_AsWCharPtrAndSize(VALUE obj, wchar_t **cptr, size_t *psize, int *alloc) } } -%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_FromCharPtrAndSize") { +%fragment("SWIG_FromWCharPtrAndSize","header",fragment="",fragment="SWIG_pwchar_descriptor",fragment="SWIG_FromCharPtrAndSize",fragment="SWIG_ruby_wstring_encoding_init") { SWIGINTERNINLINE VALUE SWIG_FromWCharPtrAndSize(const wchar_t * carray, size_t size) { diff --git a/Lib/ruby/std_wstring.i b/Lib/ruby/std_wstring.i index 38149e4ed..f2487077b 100644 --- a/Lib/ruby/std_wstring.i +++ b/Lib/ruby/std_wstring.i @@ -40,7 +40,7 @@ static rb_encoding *swig_ruby_internal_encoding; #endif %} -%init{ +%fragment("SWIG_ruby_wstring_encoding_init", "init") { swig_ruby_wstring_encoding = rb_enc_find( SWIG_RUBY_WSTRING_ENCODING ); swig_ruby_internal_encoding = rb_enc_find( SWIG_RUBY_INTERNAL_ENCODING ); }