curses 1.3.0-x86-mingw32 → 1.3.1-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
  SHA256:
3
- metadata.gz: 5b4b1a96db6c9366ea949b9c20760518cff4cf7311f087f3857f70ee55fad7a3
4
- data.tar.gz: 0c6ab70e2aaa051bf857611cee459040b0200cd50bc8d465f507d5873760d2ec
3
+ metadata.gz: 87702391a8f8ae68c0fc28e93feeb6cdd1a7d2946d36887272518e2ed51c2473
4
+ data.tar.gz: ee5ce336855c9737d0a38fc4a5e0f0a24c772393ce0fabc235db143e379a6cef
5
5
  SHA512:
6
- metadata.gz: b1e28f0519971fd78884a969dd1dd6ee8fb052076114c0c8a9b9b54c2ce1179fc1f778fb2afbbde6136a9c2ac35635941d847f1541bb54f450be136f81116ae2
7
- data.tar.gz: 6b4fa2f5632dc64805fb97ffa1f3d4c3dfb3b723c64e3c7454394095e6878ea2959ff5200ca37f9ed9f0676f83d3084670efc4d5a11316c8b80b9f8d1fd1ed81
6
+ metadata.gz: c62d672416b112065b147698a4b04935fca244d7909b8e8575bbefd2d1f54b886e27caf22a4f8e9718a2ee37c91c85f161c19134060cf20a4748fec2df09ecea
7
+ data.tar.gz: 469eb21e8e5e59b76904f8dece5ee94ab299d339c5f9aec634ac09009b307ea7aca3d39038bab5c168f0530b1e4ee1dafcbc751ee87244654804c4cc9d8b870b
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:
@@ -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"
@@ -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")
Binary file
Binary file
Binary file
@@ -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: 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: 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