From e827c334c3a03e1ad75792605c021695a5b74fd6 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 15 Jul 2016 00:53:50 +0000 Subject: enc/unicode: check Unicode versions * enc/unicode/case-folding.rb, tool/enc-unicode.rb: check if Unicode versions are consistent with each other. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55687 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- tool/enc-unicode.rb | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'tool') diff --git a/tool/enc-unicode.rb b/tool/enc-unicode.rb index 4eea2108ec..e7b979a639 100755 --- a/tool/enc-unicode.rb +++ b/tool/enc-unicode.rb @@ -454,6 +454,18 @@ uniname2ctype(const UChar *name, unsigned int len) return -1; } __HEREDOC +versions = $unicode_version.scan(/\d+/) +print("#if defined ONIG_UNICODE_VERSION_STRING && !( \\\n") +%w[MAJOR MINOR TEENY].zip(versions) do |n, v| + print(" ONIG_UNICODE_VERSION_#{n} == #{v} && \\\n") +end +print(" 1)\n") +print("# error ONIG_UNICODE_VERSION_STRING mismatch\n") +print("#endif\n") +print("#define ONIG_UNICODE_VERSION_STRING #{$unicode_version.dump}\n") +%w[MAJOR MINOR TEENY].zip(versions) do |n, v| + print("#define ONIG_UNICODE_VERSION_#{n} #{v}\n") +end output.restore -- cgit v1.2.3