summaryrefslogtreecommitdiff
path: root/ext/gdbm/extconf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-04 23:33:04 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-04 23:33:04 +0000
commit20904659c3e8911e222a6d86cdddc114e75ca4d7 (patch)
treebeae9f767073c1860117c6311741b2076f179305 /ext/gdbm/extconf.rb
parentad48d998763c7d58ea7a90b00d280125659a74d1 (diff)
gdbm: typed data
* ext/gdbm/gdbm.c (dbm_type): turn into typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47795 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/gdbm/extconf.rb')
-rw-r--r--ext/gdbm/extconf.rb11
1 files changed, 11 insertions, 0 deletions
diff --git a/ext/gdbm/extconf.rb b/ext/gdbm/extconf.rb
index 5a09492..389bfb6 100644
--- a/ext/gdbm/extconf.rb
+++ b/ext/gdbm/extconf.rb
@@ -3,5 +3,16 @@ require 'mkmf'
dir_config("gdbm")
if have_library("gdbm", "gdbm_open") and
have_header("gdbm.h")
+ checking_for("sizeof(DBM) is available") {
+ if try_compile(<<SRC)
+#include <gdbm.h>
+
+const int sizeof_DBM = (int)sizeof(DBM);
+SRC
+ $defs << '-DDBM_SIZEOF_DBM=sizeof(DBM)'
+ else
+ $defs << '-DDBM_SIZEOF_DBM=0'
+ end
+ }
create_makefile("gdbm")
end