summaryrefslogtreecommitdiff
path: root/enc/unicode/case-folding.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-15 00:53:50 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2016-07-15 00:53:50 +0000
commite827c334c3a03e1ad75792605c021695a5b74fd6 (patch)
tree2fffe7ceaa4d951cb26fb3ae878ea2a334003ba4 /enc/unicode/case-folding.rb
parented5401a696fe284b71c015fb4974396755354a7d (diff)
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
Diffstat (limited to 'enc/unicode/case-folding.rb')
-rwxr-xr-xenc/unicode/case-folding.rb10
1 files changed, 9 insertions, 1 deletions
diff --git a/enc/unicode/case-folding.rb b/enc/unicode/case-folding.rb
index 2b503ad65f..ef97baf737 100755
--- a/enc/unicode/case-folding.rb
+++ b/enc/unicode/case-folding.rb
@@ -155,8 +155,16 @@ class CaseFolding
dest.print("/* DO NOT EDIT THIS FILE. */\n")
dest.print("/* Generated by enc/unicode/case-folding.rb */\n\n")
+ versions = version.scan(/\d+/)
+ dest.print("#if defined ONIG_UNICODE_VERSION_STRING && !( \\\n")
+ %w[MAJOR MINOR TEENY].zip(versions) do |n, v|
+ dest.print(" ONIG_UNICODE_VERSION_#{n} == #{v} && \\\n")
+ end
+ dest.print(" 1)\n")
+ dest.print("# error ONIG_UNICODE_VERSION_STRING mismatch\n")
+ dest.print("#endif\n")
dest.print("#define ONIG_UNICODE_VERSION_STRING #{version.dump}\n")
- %w[MAJOR MINOR TEENY].zip(version.scan(/\d+/)) do |n, v|
+ %w[MAJOR MINOR TEENY].zip(versions) do |n, v|
dest.print("#define ONIG_UNICODE_VERSION_#{n} #{v}\n")
end
dest.print("\n")