curses 1.2.2-x86-mingw32 → 1.2.3-x86-mingw32

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1f3d8d7657551aeedc577c13b92d6999c3955d12
4
- data.tar.gz: 2494cab8da17cf5d9e9a358b86ab98c6cc7934fd
3
+ metadata.gz: ae1a403a5cf98c4556460ed4283a22d2db100d79
4
+ data.tar.gz: 2a444e3eda04735adbcb384af0fd9022dc7f9258
5
5
  SHA512:
6
- metadata.gz: 441ebd565fec09af89f27c002eb84804e51c8c94f9684c77c24eae946a51c7e89e54e41f641f59401d6be0cdf1cb5bbe8c9cf90ac55b16f42acf5188b54f7171
7
- data.tar.gz: 8c4f11f6099263db5c00af27cf66bca483d271476578890ef17e9052b44595173ff17c58fea9cf75aa45348bce960f25a9526ac93b1091ae8e49be9a8b68f42b
6
+ metadata.gz: 6283e52c1d4cd95428dbe8fa6d889422a0757b3c4a3f2a1da342d7a372bb760174559ec46fc7fb1ad27f92af124525c3753e3628860a5808e08c5c435321022b
7
+ data.tar.gz: 89510d080693330b0a9a40da47145c6537f6544621f6ccc668f582e28433def918fec5d8a50e38e1bc3636a0b44337f94e91fabaea07ddf7b263aa29fa3e3bfa
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
@@ -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"
@@ -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")
Binary file
Binary file
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: x86-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