* ext/extmk.rb: Makefiles should depend on also rbconfig.rb.

(ruby-bugs:PR#1256)

* ext/win32ole/win32ole.c (set_argv): set real arguments to
  WIN32OLE::ARGV.  [ruby-list:39073]


git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5553 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
nobu 2004-01-26 02:35:30 +00:00
Родитель c88e3627cf
Коммит 6e0b3ca606
4 изменённых файлов: 29 добавлений и 15 удалений

Просмотреть файл

@ -1,3 +1,11 @@
Mon Jan 26 11:30:58 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>
* ext/extmk.rb: Makefiles should depend on also rbconfig.rb.
(ruby-bugs:PR#1256)
* ext/win32ole/win32ole.c (set_argv): set real arguments to
WIN32OLE::ARGV. [ruby-list:39073]
Sun Jan 25 18:25:26 2004 GOTOU Yuuzou <gotoyuzo@notwork.org> Sun Jan 25 18:25:26 2004 GOTOU Yuuzou <gotoyuzo@notwork.org>
* ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): third * ext/openssl/ossl_x509name.c (ossl_x509name_add_entry): third

Просмотреть файл

@ -186,7 +186,7 @@ end
$ruby << " -I$(topdir) -I$(hdrdir)/lib" $ruby << " -I$(topdir) -I$(hdrdir)/lib"
$config_h = '$(topdir)/config.h' $config_h = '$(topdir)/config.h'
MTIMES = [__FILE__, srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)} MTIMES = [__FILE__, 'rbconfig.rb', srcdir+'/lib/mkmf.rb'].collect {|f| File.mtime(f)}
# get static-link modules # get static-link modules
$static_ext = {} $static_ext = {}

Просмотреть файл

@ -5,11 +5,13 @@
#---------------------------------- #----------------------------------
require 'mkmf' require 'mkmf'
dir_config("win32")
def create_win32ole_makefile def create_win32ole_makefile
if have_library("ole32") and if have_library("ole32") and
have_library("oleaut32") and have_library("oleaut32") and
have_library("uuid") and have_library("uuid") and
have_library("user32") and have_library("user32") and
have_library("kernel32") and
have_library("advapi32") and have_library("advapi32") and
have_header("windows.h") have_header("windows.h")
create_makefile("win32ole") create_makefile("win32ole")

Просмотреть файл

@ -1685,6 +1685,22 @@ hash2named_arg(pair, pOp)
return Qnil; return Qnil;
} }
static VALUE
set_argv(realargs, beg, end)
VARIANTARG* realargs;
unsigned int beg, end;
{
VALUE argv = rb_const_get(cWIN32OLE, rb_intern("ARGV"));
Check_Type(argv, T_ARRAY);
rb_ary_clear(argv);
while (--end >= beg) {
rb_ary_push(argv, ole_variant2val(&realargs[end]));
VariantClear(&realargs[end]);
}
return argv;
}
static VALUE static VALUE
ole_invoke(argc, argv, self, wFlags) ole_invoke(argc, argv, self, wFlags)
int argc; int argc;
@ -1707,7 +1723,6 @@ ole_invoke(argc, argv, self, wFlags)
DISPID* pDispID; DISPID* pDispID;
EXCEPINFO excepinfo; EXCEPINFO excepinfo;
VARIANT result; VARIANT result;
VALUE args;
VARIANTARG* realargs = NULL; VARIANTARG* realargs = NULL;
unsigned int argErr = 0; unsigned int argErr = 0;
unsigned int i; unsigned int i;
@ -1847,13 +1862,7 @@ ole_invoke(argc, argv, self, wFlags)
} }
/* clear dispatch parameter */ /* clear dispatch parameter */
if(op.dp.cArgs > cNamedArgs) { if(op.dp.cArgs > cNamedArgs) {
args = rb_cvar_get(cWIN32OLE, rb_intern("ARGV")); set_argv(realargs, cNamedArgs, op.dp.cArgs);
rb_funcall(args, rb_intern("clear"), 0);
for(i = cNamedArgs; i < op.dp.cArgs; i++) {
n = op.dp.cArgs - i + cNamedArgs - 1;
rb_ary_push(args, ole_variant2val(&realargs[n]));
VariantClear(&realargs[n]);
}
} }
else { else {
for(i = 0; i < op.dp.cArgs; i++) { for(i = 0; i < op.dp.cArgs; i++) {
@ -2066,12 +2075,7 @@ ole_invoke2(self, dispid, args, types, dispkind)
/* clear dispatch parameter */ /* clear dispatch parameter */
if(dispParams.cArgs > 0) { if(dispParams.cArgs > 0) {
VALUE argv = rb_cvar_get(cWIN32OLE, rb_intern("ARGV")); set_argv(realargs, 0, dispParams.cArgs);
rb_funcall(argv, rb_intern("clear"), 0);
for(i = dispParams.cArgs - 1; i >= 0; i--) {
rb_ary_push(argv, ole_variant2val(&realargs[i]));
VariantClear(&realargs[i]);
}
} }
obj = ole_variant2val(&result); obj = ole_variant2val(&result);