diff options
Diffstat (limited to 'tool/enc-unicode.rb')
-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 } } |