diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-23 07:59:56 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-03-23 07:59:56 +0000 |
commit | 40725da02d04f5b5ea1b5e74410812026dc82ef1 (patch) | |
tree | f1e1fa79427ce19ae9389eaeab629d5f34a1ec8d /tool | |
parent | 9882dbbe0449492a2b28631654e6598979c4b787 (diff) | |
download | ruby-40725da02d04f5b5ea1b5e74410812026dc82ef1.tar.gz |
enc-unicode.rb: uniname2ctype_offset
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58065 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'tool')
-rwxr-xr-x | tool/enc-unicode.rb | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index eddd39747a..17308fe7fa 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -436,6 +436,7 @@ struct uniname2ctype_struct { short name; unsigned short ctype; }; +#define uniname2ctype_offset(str) offsetof(struct uniname2ctype_pool_t, uniname2ctype_pool_##str) static const struct uniname2ctype_struct *uniname2ctype_p(const char *, unsigned int); %} @@ -525,8 +526,8 @@ if header IO.popen(%W[diff -DUSE_UNICODE_AGE_PROPERTIES #{fds[1].path} #{fds[0].path}], "r") {|age| IO.popen(%W[diff -DUSE_UNICODE_PROPERTIES #{fds[2].path} -], "r", in: age) {|f| f.each {|line| - line.gsub!(/\(int\)\(long\)&\(\((struct uniname2ctype_pool_t) \*\)0\)->(uniname2ctype_pool_str\d+),\s+/, - 'offsetof(\1, \2), ') + line.gsub!(/\(int\)\(long\)&\(\(struct uniname2ctype_pool_t \*\)0\)->uniname2ctype_pool_(str\d+),\s+/, + 'uniname2ctype_offset(\1), ') puts line } } |