curses 1.2.2-x64-mingw32 → 1.2.3-x64-mingw32

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4b6f5057f0c8b4d5c649aea752ee2bb6a6fd98a7
4
- data.tar.gz: 662d14344e906088dc94be6e5d3b4659fa5b4dae
3
+ metadata.gz: e033760a81b7ef2c153482ce59d465fb475da147
4
+ data.tar.gz: b46e65d014a37f49757a2916eb43c639a34dbadb
5
5
  SHA512:
6
- metadata.gz: 44a9b0edc65ba8663259fcd24cb79e4b97d172fb1352cb3ecd5b24f517686ac157166949a3144770f16c38533fc20cfd1e90bef6dbce7a67ed7cdd167249beba
7
- data.tar.gz: d4b62529329c95184908e5a8ddb4e17e9e760c4fb96b643d19c8ca109d1efef20fa9f806f4784054c61cd10b8b53ad38b0d7e5dd31b38d03e2802a9a529c87aa
6
+ metadata.gz: 91d3e6bcf4d960e44ccb2fb25354a714b9d1c6432ed55f4eb3f3af01bd4e8d0cd4726769069d8cea0d162ddb95a1388cca17f8220e1b5588de66cfe0c9431ef0
7
+ data.tar.gz: 7d98e116ebbd41b6e49f485c76b31c4460c10793a80df4814961606148a0de4bc9e96ae903b6bdea9b575d695fa32d6bb5561362332d6c49a6376e4ffa725e11
data/History.md CHANGED
@@ -1,3 +1,9 @@
1
+ ### 1.2.3 / 2017-07-03
2
+
3
+ Bug fixes:
4
+
5
+ * Fixes for mswin. Pull requests #30, #31, #32 and #33 by unak.
6
+
1
7
  ### 1.2.2 / 2017-04-22
2
8
 
3
9
  New features:
data/Rakefile CHANGED
@@ -25,15 +25,15 @@ namespace :build do
25
25
  mkdir_p "vendor/x64-mingw32/PDCurses"
26
26
  chdir "vendor/PDCurses/win32" do
27
27
  if $mswin
28
- sh "nmake -f vcwin32.mak clean all WIDE=Y"
29
- cp "pdcurses.lib", "../../#{RUBY_PLATFORM}/PDCurses"
30
- end
31
-
32
- sh "make -f mingwin32.mak clean all _linux_w32=1 WIDE=Y DLL=Y"
33
- cp "pdcurses.dll", "../../x86-mingw32/PDCurses"
28
+ sh "nmake -f vcwin32.mak clean all WIDE=Y DLL=Y"
29
+ cp %w[pdcurses.dll pdcurses.lib], "../../#{RUBY_PLATFORM}/PDCurses"
30
+ else
31
+ sh "make -f mingwin32.mak clean all _linux_w32=1 WIDE=Y DLL=Y"
32
+ cp "pdcurses.dll", "../../x86-mingw32/PDCurses"
34
33
 
35
- sh "make -f mingwin32.mak clean all _linux_w64=1 WIDE=Y DLL=Y"
36
- cp "pdcurses.dll", "../../x64-mingw32/PDCurses"
34
+ sh "make -f mingwin32.mak clean all _linux_w64=1 WIDE=Y DLL=Y"
35
+ cp "pdcurses.dll", "../../x64-mingw32/PDCurses"
36
+ end
37
37
  end
38
38
  end
39
39
  end
@@ -54,8 +54,10 @@ Rake::ExtensionTask.new(spec.name, spec) do |ext|
54
54
  ext.config_options << '--with-curses-include=' +
55
55
  File.expand_path("vendor/PDCurses", __dir__) +
56
56
  ' --with-curses-version=function --enable-pdcurses-wide' +
57
+ ' --enable-pdcurses-dll' +
57
58
  ' --with-curses-lib=' +
58
59
  File.expand_path("vendor/#{RUBY_PLATFORM}/PDCurses", __dir__)
60
+ spec.files += ["vendor/#{RUBY_PLATFORM}/PDCurses/pdcurses.dll"]
59
61
  end
60
62
 
61
63
  ext.cross_compile = true
data/curses.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new { |s|
2
2
  s.name = "curses"
3
- s.version = "1.2.2"
3
+ s.version = "1.2.3"
4
4
  s.author = ["Shugo Maeda", 'Eric Hodel']
5
5
  s.email = ["shugo@ruby-lang.org", 'drbrain@segment7.net']
6
6
  s.homepage = "https://github.com/ruby/curses"
data/ext/curses/curses.c CHANGED
@@ -138,8 +138,21 @@ prep_window(VALUE class, WINDOW *window)
138
138
  return obj;
139
139
  }
140
140
 
141
+ #if (defined(HAVE_ADDNWSTR) || defined(HAVE_WADDNWSTR)) && defined(_WIN32)
142
+ static inline rb_encoding *
143
+ get_wide_encoding(void)
144
+ {
145
+ static rb_encoding *utf16le = NULL;
146
+ if (!utf16le) {
147
+ utf16le = rb_enc_find("utf-16le");
148
+ }
149
+ return utf16le;
150
+ }
151
+ #endif
152
+
141
153
  /*-------------------------- module Curses --------------------------*/
142
154
 
155
+ static void curses_finalize(VALUE);
143
156
  /*
144
157
  * Document-method: Curses.init_screen
145
158
  *
@@ -155,6 +168,7 @@ curses_init_screen(void)
155
168
  if (stdscr == 0) {
156
169
  rb_raise(rb_eRuntimeError, "can't initialize curses");
157
170
  }
171
+ rb_set_end_proc(curses_finalize, 0);
158
172
  clear();
159
173
  rb_stdscr = prep_window(cWindow, stdscr);
160
174
  return rb_stdscr;
@@ -648,11 +662,19 @@ static VALUE
648
662
  curses_addstr(VALUE obj, VALUE str)
649
663
  {
650
664
  StringValue(str);
665
+ #if defined(HAVE_ADDNWSTR) && defined(_WIN32)
666
+ str = rb_str_export_to_enc(str, get_wide_encoding());
667
+ curses_stdscr();
668
+ if (!NIL_P(str)) {
669
+ addnwstr((wchar_t *)RSTRING_PTR(str), RSTRING_LEN(str) / sizeof(wchar_t));
670
+ }
671
+ #else
651
672
  str = rb_str_export_to_enc(str, terminal_encoding);
652
673
  curses_stdscr();
653
674
  if (!NIL_P(str)) {
654
675
  addstr(StringValueCStr(str));
655
676
  }
677
+ #endif
656
678
  return Qnil;
657
679
  }
658
680
 
@@ -2118,9 +2140,15 @@ window_addstr(VALUE obj, VALUE str)
2118
2140
  struct windata *winp;
2119
2141
 
2120
2142
  StringValue(str);
2143
+ #if defined(HAVE_WADDNWSTR) && defined(_WIN32)
2144
+ str = rb_str_export_to_enc(str, get_wide_encoding());
2145
+ GetWINDOW(obj, winp);
2146
+ waddnwstr(winp->window, (wchar_t *)RSTRING_PTR(str), RSTRING_LEN(str) / sizeof(wchar_t));
2147
+ #else
2121
2148
  str = rb_str_export_to_enc(str, terminal_encoding);
2122
2149
  GetWINDOW(obj, winp);
2123
2150
  waddstr(winp->window, StringValueCStr(str));
2151
+ #endif
2124
2152
  }
2125
2153
  return Qnil;
2126
2154
  }
@@ -4827,6 +4855,4 @@ Init_curses(void)
4827
4855
  rb_curses_define_const(PDC_KEY_MODIFIER_NUMLOCK);
4828
4856
  #endif
4829
4857
  #undef rb_curses_define_const
4830
-
4831
- rb_set_end_proc(curses_finalize, 0);
4832
4858
  }
@@ -57,9 +57,9 @@ if header_library
57
57
 
58
58
  for f in %w(beep bkgd bkgdset curs_set deleteln doupdate flash
59
59
  getbkgd getnstr init isendwin keyname keypad resizeterm
60
- scrl set setscrreg ungetch
60
+ scrl set setscrreg ungetch addnwstr
61
61
  wattroff wattron wattrset wbkgd wbkgdset wdeleteln wgetnstr
62
- wresize wscrl wsetscrreg werase redrawwin
62
+ wresize wscrl wsetscrreg werase redrawwin waddnwstr
63
63
  touchwin untouchwin wtouchln is_linetouched is_wintouched
64
64
  def_prog_mode reset_prog_mode timeout wtimeout nodelay
65
65
  init_color wcolor_set use_default_colors assume_default_colors
@@ -137,6 +137,10 @@ if header_library
137
137
  $defs << '-DPDC_WIDE'
138
138
  end
139
139
 
140
+ if enable_config("pdcurses-dll")
141
+ $defs << '-DPDC_DLL_BUILD'
142
+ end
143
+
140
144
  if RUBY_VERSION >= '2.1'
141
145
  create_header
142
146
  create_makefile("curses")
data/lib/2.2/curses.so CHANGED
Binary file
data/lib/2.3/curses.so CHANGED
Binary file
data/lib/2.4/curses.so CHANGED
Binary file
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: curses
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
5
5
  platform: x64-mingw32
6
6
  authors:
7
7
  - Shugo Maeda
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2017-04-22 00:00:00.000000000 Z
12
+ date: 2017-07-02 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -109,7 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  version: '0'
110
110
  requirements: []
111
111
  rubyforge_project:
112
- rubygems_version: 2.6.11
112
+ rubygems_version: 2.6.12
113
113
  signing_key:
114
114
  specification_version: 4
115
115
  summary: A Ruby binding for curses, ncurses, and PDCurses. curses is an extension