diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-27 02:37:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2006-06-27 02:37:01 +0000 |
commit | 6de2f53f986465a0d0d86eb8619ebd7cf5bce1e8 (patch) | |
tree | 9904eb92fc62a5d4d4843b7569693d3eb2d25fa3 /ext/etc/extconf.rb | |
parent | 8ae45d642f086128e9f632cb8320d78bf5528735 (diff) | |
download | ruby-6de2f53f986465a0d0d86eb8619ebd7cf5bce1e8.tar.gz |
* ext/etc/etc.c (setup_passwd, setup_group): allow bignum uid, gid and
so on. [ruby-talk:199102]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@10408 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/etc/extconf.rb')
-rw-r--r-- | ext/etc/extconf.rb | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/ext/etc/extconf.rb b/ext/etc/extconf.rb index 0dc8e7ddac..5cdb824fda 100644 --- a/ext/etc/extconf.rb +++ b/ext/etc/extconf.rb @@ -24,6 +24,19 @@ if a or b or c have_struct_member('struct passwd', 'pw_expire', 'pwd.h') have_struct_member('struct passwd', 'pw_passwd', 'pwd.h') have_struct_member('struct group', 'gr_passwd', 'grp.h') - have_type("uid_t"); + [%w"uid_t pwd.h", %w"gid_t grp.h"].each do |t, *h| + h << "sys/types.h" + if have_type(t, h) + if try_static_assert("sizeof(#{t}) > sizeof(long)", h) + f = "LL2NUM" + else + f = "INT2NUM" + end + if try_static_assert("(#{t})-1 > 0", h) + f = "U#{f}" + end + $defs.push("-DPW_#{t.chomp('_t').upcase}2VAL=#{f}") + end + end create_makefile("etc") end |