diff options
author | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-27 15:26:19 +0000 |
---|---|---|
committer | shugo <shugo@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-09-27 15:26:19 +0000 |
commit | 2328b4b29a75b7a9438e9f6b562b32214dcd8d48 (patch) | |
tree | 22570de2bbfd10280657d61b9d1b46a1ea95414b /ext/curses/extconf.rb | |
parent | 0e2f5210571d991f9f1dc52af9969a2e2100ab1a (diff) | |
download | ruby-2328b4b29a75b7a9438e9f6b562b32214dcd8d48.tar.gz |
* ext/curses/extconf.rb: check the size of chtype.
* ext/curses/curses.c (NUM2CH, CH2NUM): use proper macros for
the size of chtype.
[ruby-core:56090] [Bug #8659]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@43074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/curses/extconf.rb')
-rw-r--r-- | ext/curses/extconf.rb | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/ext/curses/extconf.rb b/ext/curses/extconf.rb index 3e53ef65f7..a95b49ffea 100644 --- a/ext/curses/extconf.rb +++ b/ext/curses/extconf.rb @@ -129,5 +129,13 @@ if header_library warn "unexpeted value for --with-curses-version: #{with_curses_version}" end + for type in ["long", "int"] + if try_static_assert("sizeof(chtype) == sizeof(unsigned #{type})", + %w[stdio.h stdlib.h]+curses) + $defs << "-DCHTYPE_IS_U#{type.upcase}" + break + end + end + create_makefile("curses") end |