curses 1.3.0-x64-mingw32 → 1.3.1-x64-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
  SHA256:
3
- metadata.gz: 1e22449c27f9ebfbeabef55fb9020dd122f68dab757c03d67f10ee06e556795f
4
- data.tar.gz: b1cf7129183a61c92b448bba254130e17553c7332fc2922995bcaec4af4101ef
3
+ metadata.gz: 7d921227eb4f44e17b78e99e8aef59b98728f297c1a77f86e344be6acace9799
4
+ data.tar.gz: 32073961b8d7873fc2a6b1f4e7b5658c19f48cb0cc6063514f29727c02d1b014
5
5
  SHA512:
6
- metadata.gz: b73dc31f02159f9f5086ef60508befdc2d6e2f29b42cbb7accaf16da3acbef64960b2f973ea6c93e4b5c410807dca3415719933365d7b97152b69cce1e549c7e
7
- data.tar.gz: 749e463b6021151480813e32db6a292eeeb2e679d6f203e724e609b7fa4fe9330f2289f1d5faa9f3600444492fede79c4f540d1537f0cfe85dad1d5d0c031b09
6
+ metadata.gz: 4232521c6372d43e8b79b10f4c07b0b2e37acb05e3ca2e747e1ce62a366c63424480fe3fcef87db56d965f17869e7fafca6bf62e8beaa4a93084bcc9b0964a73
7
+ data.tar.gz: 5203b26592d3ffd63a2948402d4e97e0d003644c5acb631ca9d11bc1e3deb35171d7d0495e75a16199ecd71ed704caa16e35c52cad52e1a36854f60cc84d2bd7
data/History.md CHANGED
@@ -1,3 +1,10 @@
1
+ ### 1.3.1 / 2019-04-21
2
+
3
+ Bug fixes:
4
+
5
+ * Check whether sizeof(WINDOW) is available to avoid build failures on macOS.
6
+ Issue #48 reported by chdiza.
7
+
1
8
  ### 1.3.0 / 2019-04-16
2
9
 
3
10
  New features:
data/curses.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new { |s|
2
2
  s.name = "curses"
3
- s.version = "1.3.0"
3
+ s.version = "1.3.1"
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
@@ -213,6 +213,7 @@ static VALUE window_attroff(VALUE obj, VALUE attrs);
213
213
  static VALUE window_attron(VALUE obj, VALUE attrs);
214
214
  static VALUE window_attrset(VALUE obj, VALUE attrs);
215
215
 
216
+ NORETURN(static void no_window(void));
216
217
  static void
217
218
  no_window(void)
218
219
  {
@@ -241,7 +242,7 @@ window_memsize(const void *p)
241
242
  const struct windata *winp = p;
242
243
  size_t size = sizeof(*winp);
243
244
  if (!winp) return 0;
244
- if (winp->window && winp->window != stdscr) size += sizeof(*winp->window);
245
+ if (winp->window && winp->window != stdscr) size += CURSES_SIZEOF_WINDOW;
245
246
  return size;
246
247
  }
247
248
 
@@ -1439,6 +1440,7 @@ struct mousedata {
1439
1440
  MEVENT *mevent;
1440
1441
  };
1441
1442
 
1443
+ NORETURN(static void no_mevent(void));
1442
1444
  static void
1443
1445
  no_mevent(void)
1444
1446
  {
@@ -1466,7 +1468,7 @@ curses_mousedata_memsize(const void *p)
1466
1468
  const struct mousedata *mdata = p;
1467
1469
  size_t size = sizeof(*mdata);
1468
1470
  if (!mdata) return 0;
1469
- if (mdata->mevent) size += sizeof(*mdata->mevent);
1471
+ if (mdata->mevent) size += CURSES_SIZEOF_MEVENT;
1470
1472
  return size;
1471
1473
  }
1472
1474
 
@@ -3063,7 +3065,7 @@ item_memsize(const void *p)
3063
3065
  const struct itemdata *itemp = p;
3064
3066
  size_t size = sizeof(*itemp);
3065
3067
  if (!itemp) return 0;
3066
- if (itemp->item) size += sizeof(*itemp->item);
3068
+ if (itemp->item) size += CURSES_SIZEOF_ITEM;
3067
3069
  return size;
3068
3070
  }
3069
3071
 
@@ -3274,7 +3276,7 @@ menu_memsize(const void *p)
3274
3276
  const struct menudata *menup = p;
3275
3277
  size_t size = sizeof(*menup);
3276
3278
  if (!menup) return 0;
3277
- if (menup->menu) size += sizeof(*menup->menu);
3279
+ if (menup->menu) size += CURSES_SIZEOF_MENU;
3278
3280
  return size;
3279
3281
  }
3280
3282
 
@@ -3706,6 +3708,7 @@ struct fielddata {
3706
3708
  FIELD *field;
3707
3709
  };
3708
3710
 
3711
+ NORETURN(static void no_field(void));
3709
3712
  static void
3710
3713
  no_field(void)
3711
3714
  {
@@ -3734,7 +3737,7 @@ field_memsize(const void *p)
3734
3737
  const struct fielddata *fieldp = p;
3735
3738
  size_t size = sizeof(*fieldp);
3736
3739
  if (!fieldp) return 0;
3737
- if (fieldp->field) size += sizeof(*fieldp->field);
3740
+ if (fieldp->field) size += CURSES_SIZEOF_FIELD;
3738
3741
  return size;
3739
3742
  }
3740
3743
 
@@ -4152,6 +4155,7 @@ struct formdata {
4152
4155
  VALUE fields;
4153
4156
  };
4154
4157
 
4158
+ NORETURN(static void no_form(void));
4155
4159
  static void
4156
4160
  no_form(void)
4157
4161
  {
@@ -4191,7 +4195,7 @@ form_memsize(const void *p)
4191
4195
  const struct formdata *formp = p;
4192
4196
  size_t size = sizeof(*formp);
4193
4197
  if (!formp) return 0;
4194
- if (formp->form) size += sizeof(*formp->form);
4198
+ if (formp->form) size += CURSES_SIZEOF_FORM;
4195
4199
  return size;
4196
4200
  }
4197
4201
 
@@ -1,4 +1,5 @@
1
1
  require 'mkmf'
2
+ require 'shellwords'
2
3
 
3
4
  def have_all(*args)
4
5
  old_libs = $libs.dup
@@ -160,6 +161,57 @@ if header_library
160
161
  have_func("form_driver_w")
161
162
  end
162
163
 
164
+ ["WINDOW", "MEVENT", "ITEM", "MENU", "FIELD", "FORM"].each do |type|
165
+ checking_for("sizeof(#{type}) is available") {
166
+ if try_compile(<<EOF, Shellwords.join($defs))
167
+ #if defined(HAVE_NCURSESW_CURSES_H)
168
+ # include <ncursesw/curses.h>
169
+ #elif defined(HAVE_NCURSES_CURSES_H)
170
+ # include <ncurses/curses.h>
171
+ #elif defined(HAVE_NCURSES_H)
172
+ # include <ncurses.h>
173
+ #elif defined(HAVE_CURSES_COLR_CURSES_H)
174
+ # ifdef HAVE_STDARG_PROTOTYPES
175
+ # include <stdarg.h>
176
+ # else
177
+ # include <varargs.h>
178
+ # endif
179
+ # include <curses_colr/curses.h>
180
+ #else
181
+ # include <curses.h>
182
+ #endif
183
+
184
+ #if defined(HAVE_NCURSESW_MENU_H)
185
+ # include <ncursesw/menu.h>
186
+ #elif defined(HAVE_NCURSES_MENU_H)
187
+ # include <ncurses/menu.h>
188
+ #elif defined(HAVE_CURSES_MENU_H)
189
+ # include <curses/menu.h>
190
+ #elif defined(HAVE_MENU_H)
191
+ # include <menu.h>
192
+ #endif
193
+
194
+ #if defined(HAVE_NCURSESW_FORM_H)
195
+ # include <ncursesw/form.h>
196
+ #elif defined(HAVE_NCURSES_FORM_H)
197
+ # include <ncurses/form.h>
198
+ #elif defined(HAVE_CURSES_FORM_H)
199
+ # include <curses/form.h>
200
+ #elif defined(HAVE_FORM_H)
201
+ # include <form.h>
202
+ #endif
203
+
204
+ const int sizeof_#{type} = (int) sizeof(#{type});
205
+ EOF
206
+ $defs << "-DCURSES_SIZEOF_#{type}=sizeof(#{type})"
207
+ true
208
+ else
209
+ $defs << "-DCURSES_SIZEOF_#{type}=0"
210
+ false
211
+ end
212
+ }
213
+ end
214
+
163
215
  if RUBY_VERSION >= '2.1'
164
216
  create_header
165
217
  create_makefile("curses")
data/lib/2.4/curses.so CHANGED
Binary file
data/lib/2.5/curses.so CHANGED
Binary file
data/lib/2.6/curses.so CHANGED
Binary file
data/sample/menu.rb CHANGED
@@ -9,9 +9,9 @@ at_exit do
9
9
  end
10
10
 
11
11
  menu = Curses::Menu.new([
12
- ["Apple", "Red fruit"],
13
- ["Orange", "Orange fruit"],
14
- ["Banana", "Yellow fruit"]
12
+ Curses::Item.new("Apple", "Red fruit"),
13
+ Curses::Item.new("Orange", "Orange fruit"),
14
+ Curses::Item.new("Banana", "Yellow fruit")
15
15
  ])
16
16
  menu.post
17
17
 
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.3.0
4
+ version: 1.3.1
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: 2019-04-16 00:00:00.000000000 Z
12
+ date: 2019-04-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -109,8 +109,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
109
109
  - !ruby/object:Gem::Version
110
110
  version: '0'
111
111
  requirements: []
112
- rubyforge_project:
113
- rubygems_version: 2.7.6
112
+ rubygems_version: 3.0.3
114
113
  signing_key:
115
114
  specification_version: 4
116
115
  summary: A Ruby binding for curses, ncurses, and PDCurses. curses is an extension