Skip to content

Instantly share code, notes, and snippets.

View shirosaki's full-sized avatar

Hiroshi Shirosaki shirosaki

View GitHub Profile
@shirosaki
shirosaki / fix_test_win32ole_variant.patch
Created July 30, 2012 00:42
Set US-English locale with test_win32ole_variant
diff --git a/test/win32ole/test_win32ole_variant.rb b/test/win32ole/test_win32ole_variant.rb
index 70bfc8b..62ff217 100644
--- a/test/win32ole/test_win32ole_variant.rb
+++ b/test/win32ole/test_win32ole_variant.rb
@@ -306,6 +306,8 @@ if defined?(WIN32OLE_VARIANT)
end
def test_s_array
+ WIN32OLE.locale = 0x0409 # set US-English locale - number with decimal point
+
@shirosaki
shirosaki / 1-winstat.patch
Created August 3, 2012 14:13
Winstat patch
diff --git a/win32/win32.c b/win32/win32.c
index 458b613..8640ddd 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4554,18 +4554,11 @@ check_valid_dir(const WCHAR *path)
{
WIN32_FIND_DATAW fd;
HANDLE fh;
- WCHAR full[MAX_PATH];
- WCHAR *dmy;
@shirosaki
shirosaki / winnt_stat.patch
Created August 6, 2012 22:12
Winstat patch which adds root path check
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index a19fcd9..7d1716b 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -813,6 +813,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(0, File::Stat.new(@zerofile).size)
end
+ def test_stat_special_file
+ # test for special files such as pagefile.sys on Windows
@shirosaki
shirosaki / 1-winstat.patch
Created August 7, 2012 13:44
winnt_stat optimize patch
diff --git a/test/ruby/test_file_exhaustive.rb b/test/ruby/test_file_exhaustive.rb
index de17d7e..434c93c 100644
--- a/test/ruby/test_file_exhaustive.rb
+++ b/test/ruby/test_file_exhaustive.rb
@@ -819,6 +819,13 @@ class TestFileExhaustive < Test::Unit::TestCase
assert_equal(0, File::Stat.new(@zerofile).size)
end
+ def test_stat_special_file
+ # test for special files such as pagefile.sys on Windows
@shirosaki
shirosaki / 1-faster_load.patch
Created August 8, 2012 08:08
Remove short name expansion only on require and load
diff --git a/file.c b/file.c
index 4050067..4c86c27 100644
--- a/file.c
+++ b/file.c
@@ -2883,7 +2883,7 @@ append_fspath(VALUE result, VALUE fname, char *dir, rb_encoding **enc, rb_encodi
}
static VALUE
-file_expand_path(VALUE fname, VALUE dname, int abs_mode, VALUE result)
+file_expand_path_internal(VALUE fname, VALUE dname, int abs_mode, VALUE result, int long_name)
@shirosaki
shirosaki / bench.txt
Created August 29, 2012 15:30
benchmark scan vs unpack for utf-8 string
$ ruby -v -Ku scan_unpack_banch.rb ~
ruby 1.8.7 (2012-02-08 patchlevel 358) [universal-darwin12.0]
Rehearsal -----------------------------------------------------
scan each len: 0.140000 0.000000 0.140000 ( 0.141777)
unpack each len: 0.070000 0.000000 0.070000 ( 0.064889)
scan total len: 0.110000 0.000000 0.110000 ( 0.108800)
unpack total len: 0.000000 0.000000 0.000000 ( 0.004272)
-------------------------------------------- total: 0.320000sec
user system total real
@shirosaki
shirosaki / fix_test_pstore.patch
Created August 31, 2012 01:49
Fix test_pstore.rb to increase timeout
diff --git a/test/ruby/envutil.rb b/test/ruby/envutil.rb
index 19290c6..4fa037a 100644
--- a/test/ruby/envutil.rb
+++ b/test/ruby/envutil.rb
@@ -74,12 +74,12 @@ module EnvUtil
return stdout, stderr, status
end
ensure
- [in_c, in_p, out_c, out_p, err_c, err_p].each do |io|
- io.close if io && !io.closed?
@shirosaki
shirosaki / 1_9_3_x64.patch
Created September 10, 2012 15:10
Patch for rubenvb-4.7.1-2-release r33830 r33989 r35485 r36247 r36508 r36522 r36544
diff --git a/configure.in b/configure.in
index be818d4..bd6cf62 100644
--- a/configure.in
+++ b/configure.in
@@ -479,7 +479,7 @@ if test "$GCC:${warnflags+set}:no" = yes::no; then
])
])
done
- AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag=-Wextra],
+ AS_CASE([" $warnflags "],[*" -Wno-missing-field-initializers "*], [wflag="-Wall -Wextra"],
@shirosaki
shirosaki / 1-build_test_result.md
Created September 12, 2012 07:52
mingw-w64 ruby trunk on Windows XP 32bit

Ruby trunk on Windows XP 32bit

ruby 2.0.0dev (2012-09-11 trunk 36949) [i386-mingw32]

gcc version 4.6.3 (rubenvb-4.6.3)

make test passed.

@shirosaki
shirosaki / 1-gcc_v.txt
Created September 14, 2012 09:42
Cross compile gcc on Linux 32bit using rubenvb recipe
Using built-in specs.
COLLECT_GCC=c:\devruby\rubyinstaller\sandbox\devkit\mingw\bin\gcc.exe
COLLECT_LTO_WRAPPER=c:/devruby/rubyinstaller/sandbox/devkit/mingw/bin/../libexec/gcc/i686-w64-mingw32/4.7.1/lto-wrapper.exe
Target: i686-w64-mingw32
Configured with: /home/shirosaki/mingw-w64/src/gcc/configure --host=i686-w64-mingw32 --build=i686-linux-gnu --target=i686-w64-mingw32 --with-sysroot=/home/shirosaki/mingw-w64/mingw32mingw32/mingw32 --prefix=/home/shirosaki/mingw-w64/mingw32mingw32/mingw32 --with-gmp=/home/shirosaki/mingw-w64/prereq/i686-w64-mingw32/install --with-mpfr=/home/shirosaki/mingw-w64/prereq/i686-w64-mingw32/install --with-mpc=/home/shirosaki/mingw-w64/prereq/i686-w64-mingw32/install --with-ppl=/home/shirosaki/mingw-w64/prereq/i686-w64-mingw32/install --with-cloog=/home/shirosaki/mingw-w64/prereq/i686-w64-mingw32/install --disable-ppl-version-check --disable-cloog-version-check --enable-cloog-backend=isl --with-host-libstdcxx='-static -lstdc++ -lm' --enable-shared --enable-static --enable-threads=