summaryrefslogtreecommitdiff
path: root/ext/dbm/extconf.rb
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-04 23:33:01 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2014-10-04 23:33:01 +0000
commitad48d998763c7d58ea7a90b00d280125659a74d1 (patch)
treedcb99f52515e3dae1ab82c41b21fc40a1f3c6f69 /ext/dbm/extconf.rb
parentba0655ebdd31e5e6b9ae8ede328733067a68dcbc (diff)
dbm: typed data
* ext/dbm/dbm.c (dbm_type): turn into typed data. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@47794 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/dbm/extconf.rb')
-rw-r--r--ext/dbm/extconf.rb17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/dbm/extconf.rb b/ext/dbm/extconf.rb
index 68070c9970..2c8caa398e 100644
--- a/ext/dbm/extconf.rb
+++ b/ext/dbm/extconf.rb
@@ -267,6 +267,23 @@ if dblib.any? {|db| headers.fetch(db, ["ndbm.h"]).any? {|hdr| headers.db_check(d
have_func("dbm_pagfno((DBM *)0)", headers.found, headers.defs)
have_func("dbm_dirfno((DBM *)0)", headers.found, headers.defs)
convertible_int("datum.dsize", headers.found, headers.defs)
+ checking_for("sizeof(DBM) is available") {
+ if try_compile(<<SRC)
+#ifdef HAVE_CDEFS_H
+# include <cdefs.h>
+#endif
+#ifdef HAVE_SYS_CDEFS_H
+# include <sys/cdefs.h>
+#endif
+#include DBM_HDR
+
+const int sizeof_DBM = (int)sizeof(DBM);
+SRC
+ $defs << '-DDBM_SIZEOF_DBM=sizeof(DBM)'
+ else
+ $defs << '-DDBM_SIZEOF_DBM=0'
+ end
+ }
create_makefile("dbm")
end
# :startdoc: