From 2d5b7f736518fb343469cd2bee721120309d8dca Mon Sep 17 00:00:00 2001 From: ttate Date: Sun, 9 Jun 2002 17:47:34 +0000 Subject: * ext/dl: change the callback mechanism. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@2532 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/dl/extconf.rb | 48 +++++++++++++----------------------------------- 1 file changed, 13 insertions(+), 35 deletions(-) (limited to 'ext/dl/extconf.rb') diff --git a/ext/dl/extconf.rb b/ext/dl/extconf.rb index 9f3875071e..7b7c48f1a2 100644 --- a/ext/dl/extconf.rb +++ b/ext/dl/extconf.rb @@ -11,10 +11,8 @@ if( ARGV.include?("--help") ) --with-type-char strictly use type 'char' --with-type-short strictly use type 'short' --with-type-float strictly use type 'float' - --with-args=,, - : maximum number of arguments of the function - : maximum number of arguments of the callback - : maximum number of callback entries + --with-args= + --with-callback= --enable-asm use the embedded assembler for passing arguments. (this option is available for i386 machine now.) --enable-dlstack use a stack emulation for constructing function call. @@ -58,8 +56,6 @@ $with_type_int &= DLTYPE[INT][:sym] $with_type_float &= DLTYPE[FLOAT][:sym] $with_type_voidp &= DLTYPE[VOIDP][:sym] -$with_cbtype_voidp = DLTYPE[VOIDP][:cb] - $with_type_char = enable_config("type-char", $with_type_char) $with_type_short = enable_config("type-short", $with_type_short) $with_type_float = enable_config("type-float", $with_type_float) @@ -68,7 +64,7 @@ $with_asm = enable_config("asm", $with_asm) $with_dlstack = enable_config("dlstack", $with_dlstack) args = with_config("args") -max_arg = max_cbarg = max_cbent = nil +max_arg = nil if( $with_asm || $with_dlstack ) $with_type_char = true $with_type_short = true @@ -76,31 +72,20 @@ if( $with_asm || $with_dlstack ) max_arg = 0 end if( args ) - max_arg,max_cbarg,max_cbent = args.split(",").collect{|c| c.to_i} - if( !(max_arg && max_cbarg && max_cbent) ) - print("--with-args=,,\n") + max_arg = args.to_i + if( !max_arg ) + print("--with-args=\n") exit(1) end end max_arg ||= 6 -max_cbarg ||= 3 -max_cbent ||= 3 - -max_callback_type = types2num(DLTYPE.keys.sort[-1,1] * (max_cbarg + 1)) + 1 -max_callback = max_cbent -#m = [1].pack("i") -#c,cs = m.unpack("c") -#bigendian = (c == 0) -#print("bigendian ... #{bigendian ? 'true' : 'false'}\n") +max_callback = with_config("callback","10").to_i +callback_types = DLTYPE.keys.length $dlconfig_h = <