curses 1.3.0 → 1.3.1

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: a4d2078ada136fc3603a23e253c9342efe47cc62daad3db6459c57d1822b740a
4
- data.tar.gz: 27ee0f6320474baacbe459dc52f40500240d55ce7656663cf8c8074774643fdf
3
+ metadata.gz: e01aab88579c53f7ae662c5df89c10280832e35c629688aef762da4664ae07ea
4
+ data.tar.gz: 64e74cfb2a024e1be5543893a8e4c22b13db65ec8ee78a4a8cd9b5b1dd58bc14
5
5
  SHA512:
6
- metadata.gz: dd21a812ca31bc59dc6e4377a61fc1b19d57779c95b5da48b358b28eb69f29686273de212527744038e508e0a42aed87ead357fe91f85d075eee30eed2aa1a68
7
- data.tar.gz: e378f6977737d7871074d3fd08436b447823ef347fc67cfe4d367fc245bb7238c2d7514799a2a6324c2ec5cebb544c94f5fabaacfe66adc753ecc6c372970648
6
+ metadata.gz: bde0d0f8f8a93810e881c000b2058b8edbcde64d81ebfe899799fa166ed87be60a8dcf8f758af8732082da82f4071ff44dcb715fb550cd45ca56acd8aa42a0e2
7
+ data.tar.gz: 58ae3617bd9227587cbe06e3d77b36c118cf0fdf45e501011debe117cf5d3b45cefcf0689835e822e567d21aee15a9cf510932dcee0410923161447f14a3e14f
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")
@@ -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: ruby
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
@@ -104,8 +104,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
104
104
  - !ruby/object:Gem::Version
105
105
  version: '0'
106
106
  requirements: []
107
- rubyforge_project:
108
- rubygems_version: 2.7.6
107
+ rubygems_version: 3.0.3
109
108
  signing_key:
110
109
  specification_version: 4
111
110
  summary: A Ruby binding for curses, ncurses, and PDCurses. curses is an extension