From 91d1f4745ccc4ec919d65175e2cc732652a6c581 Mon Sep 17 00:00:00 2001 From: Hiroyuki Iwatsuki Date: Tue, 6 Mar 2012 01:31:53 +0900 Subject: [PATCH 1/2] Fix platform detection for x64-mswin64 --- ext/nokogiri/extconf.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/nokogiri/extconf.rb b/ext/nokogiri/extconf.rb index 86e3ad73c74..28d44cd67fb 100644 --- a/ext/nokogiri/extconf.rb +++ b/ext/nokogiri/extconf.rb @@ -17,7 +17,7 @@ $CFLAGS << " #{ENV["CFLAGS"]}" $LIBS << " #{ENV["LIBS"]}" -if RbConfig::CONFIG['target_os'] == 'mingw32' || RbConfig::CONFIG['target_os'] =~ /mswin32/ +if RbConfig::CONFIG['target_os'] == 'mingw32' || RbConfig::CONFIG['target_os'] =~ /mswin/ $CFLAGS << " -DXP_WIN -DXP_WIN32 -DUSE_INCLUDED_VASPRINTF" elsif RbConfig::CONFIG['target_os'] =~ /solaris/ $CFLAGS << " -DUSE_INCLUDED_VASPRINTF" @@ -34,7 +34,7 @@ $CFLAGS << " -Wall -Wcast-qual -Wwrite-strings -Wconversion -Wmissing-noreturn -Winline" end -if RbConfig::CONFIG['target_os'] =~ /mswin32/ +if RbConfig::CONFIG['target_os'] =~ /mswin/ lib_prefix = 'lib' # There's no default include/lib dir on Windows. Let's just add the Ruby ones From ef1c76c22eb763d3f430efcfec5bdaf92b4365d5 Mon Sep 17 00:00:00 2001 From: Hiroyuki Iwatsuki Date: Tue, 6 Mar 2012 01:37:24 +0900 Subject: [PATCH 2/2] Fix local variable declaration --- ext/nokogiri/xml_document.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/nokogiri/xml_document.c b/ext/nokogiri/xml_document.c index 348344c244a..f6bc7ac1ceb 100644 --- a/ext/nokogiri/xml_document.c +++ b/ext/nokogiri/xml_document.c @@ -468,8 +468,6 @@ static VALUE canonicalize(int argc, VALUE* argv, VALUE self) xmlChar **ns; long ns_len, i; - rb_scan_args(argc, argv, "03", &mode, &incl_ns, &with_comments); - xmlDocPtr doc; xmlOutputBufferPtr buf; xmlC14NIsVisibleCallback cb = NULL; @@ -478,6 +476,8 @@ static VALUE canonicalize(int argc, VALUE* argv, VALUE self) VALUE rb_cStringIO; VALUE io; + rb_scan_args(argc, argv, "03", &mode, &incl_ns, &with_comments); + Data_Get_Struct(self, xmlDoc, doc); rb_cStringIO = rb_const_get_at(rb_cObject, rb_intern("StringIO"));