summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cygwin/GNUmakefile.in17
-rw-r--r--ext/extmk.rb.in19
-rw-r--r--gc.c2
-rw-r--r--hash.c6
-rw-r--r--lib/cgi.rb2
-rw-r--r--lib/mkmf.rb7
-rw-r--r--object.c3
-rw-r--r--ruby.h5
-rw-r--r--struct.c2
-rw-r--r--win32/Makefile.sub4
-rw-r--r--win32/config.status.in12
-rw-r--r--win32/resource.rb4
12 files changed, 40 insertions, 43 deletions
diff --git a/cygwin/GNUmakefile.in b/cygwin/GNUmakefile.in
index 74ef208..2dd4404 100644
--- a/cygwin/GNUmakefile.in
+++ b/cygwin/GNUmakefile.in
@@ -14,24 +14,23 @@ else
endif
WPROGRAM = $(RUBYW_INSTALL_NAME)$(EXEEXT)
RUBYDEF = $(RUBY_INSTALL_NAME).def
-RUBY_SO_NAME = $(LIBRUBY_SO:.dll=)
-SOLIBS := $(RUBY_SO_NAME).res.o $(SOLIBS)
-EXTOBJS += $(@:$(EXEEXT)=.res.o)
+SOLIBS := $(LIBRUBY_SO).res.@OBJEXT@ $(SOLIBS)
+EXTOBJS += $(@:$(EXEEXT)=.res.@OBJEXT@)
-$(LIBRUBY_SO): $(RUBYDEF) $(RUBY_SO_NAME).res.o
+$(LIBRUBY_SO): $(RUBYDEF) $(LIBRUBY_SO).res.@OBJEXT@
$(LIBRUBY): $(LIBRUBY_SO)
-%.res.o: %.rc
+%.res.@OBJEXT@: %.rc
@WINDRES@ --include-dir . --include-dir $(<D) --include-dir $(srcdir)/win32 $< $@
-$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(RUBY_SO_NAME).rc: rbconfig.rb
+$(RUBY_INSTALL_NAME).rc $(RUBYW_INSTALL_NAME).rc $(LIBRUBY_SO).rc: rbconfig.rb
@@MINIRUBY@ $(srcdir)/win32/resource.rb \
-ruby_name=$(RUBY_INSTALL_NAME) -rubyw_name=$(RUBYW_INSTALL_NAME) \
- -so_name=$(RUBY_SO_NAME) \
+ -so_name=$(LIBRUBY_SO) \
. $(icondirs) $(srcdir)/win32
-$(PROGRAM): $(RUBY_INSTALL_NAME).res.o
-$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.o
+$(PROGRAM): $(RUBY_INSTALL_NAME).res.@OBJEXT@
+$(WPROGRAM): $(RUBYW_INSTALL_NAME).res.@OBJEXT@
@rm -f $@
$(PURIFY) $(CC) -mwindows -e _mainCRTStartup $(LDFLAGS) $(XLDFLAGS) \
$(MAINOBJ) $(EXTOBJS) $(LIBRUBYARG) $(LIBS) -o $@
diff --git a/ext/extmk.rb.in b/ext/extmk.rb.in
index 1b133b6..617753f 100644
--- a/ext/extmk.rb.in
+++ b/ext/extmk.rb.in
@@ -61,8 +61,8 @@ if RUBY_PLATFORM == "m68k-human"
else
CFLAGS = "@CFLAGS@"
end
-LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s conftest.c %s %s @LIBS@"
-CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s conftest.c"
+LINK = "@CC@ -o conftest -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir @LDFLAGS@ %s %s %s conftest.c %s %s @LIBS@"
+CPP = "@CPP@ @CPPFLAGS@ -I#$topdir -I#$top_srcdir #{CFLAGS} -I#$includedir %s %s %s conftest.c"
if FileTest.readable? 'nul'
$null = open('nul', 'w')
@@ -91,7 +91,7 @@ def try_link0(src, opt="")
cfile = open("conftest.c", "w")
cfile.print src
cfile.close
- xsystem(format(LINK, $CFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
+ xsystem(format(LINK, $CFLAGS, $CPPFLAGS, $LDFLAGS, opt, $LOCAL_LIBS))
end
def try_link(src, opt="")
@@ -107,7 +107,7 @@ def try_cpp(src, opt="")
cfile.print src
cfile.close
begin
- xsystem(format(CPP, $CFLAGS, opt))
+ xsystem(format(CPP, $CFLAGS, $CPPFLAGS, opt))
ensure
rm_f "conftest*"
end
@@ -118,7 +118,7 @@ def egrep_cpp(pat, src, opt="")
cfile.print src
cfile.close
begin
- xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, opt))
+ xsystem(format(CPP+"|egrep #{pat}", $CFLAGS, $CPPFLAGS, opt))
ensure
rm_f "conftest*"
end
@@ -326,7 +326,7 @@ def dir_config(target)
ldir = " -L"+dir if dir
end
- $CFLAGS += idir if idir
+ $CPPFLAGS += idir if idir
$LDFLAGS += ldir if ldir
end
@@ -375,7 +375,7 @@ DESTDIR =
CC = @CC@
CFLAGS = %s #{CFLAGS} #$CFLAGS
-CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s
+CPPFLAGS = -I$(topdir) -I$(hdrdir) -I@includedir@ %s #$CPPFLAGS
DLDFLAGS = #$DLDFLAGS #$LDFLAGS
LDSHARED = @LDSHARED@ #{defflag}
", if $static then "" else "@CCDLFLAGS@" end, $defs.join(" ")
@@ -465,6 +465,11 @@ EOS
$(CC) -I. -I$(<D) $(CFLAGS) $(CPPFLAGS) -c $(<:/=\\)
"
+ else
+ mfile.puts "
+.c.@OBJEXT@:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c $<
+"
end
if $static
diff --git a/gc.c b/gc.c
index 753d584..9d2e7cb 100644
--- a/gc.c
+++ b/gc.c
@@ -280,9 +280,9 @@ rb_newobj()
if (!freelist) rb_gc();
- if (freelist->as.free.next && freelist->as.free.next->as.free.flag != 0) abort();
obj = (VALUE)freelist;
freelist = freelist->as.free.next;
+ MEMZERO((void*)obj, RVALUE, 1);
return obj;
}
diff --git a/hash.c b/hash.c
index 0ff6440..0d65dc9 100644
--- a/hash.c
+++ b/hash.c
@@ -171,9 +171,7 @@ rb_hash_new2(klass)
NEWOBJ(hash, struct RHash);
OBJSETUP(hash, klass, T_HASH);
- hash->iter_lev = 0;
hash->ifnone = Qnil;
- hash->tbl = 0; /* avoid GC crashing */
hash->tbl = st_init_table(&objhash);
return (VALUE)hash;
@@ -225,9 +223,7 @@ rb_hash_s_create(argc, argv, klass)
NEWOBJ(hash, struct RHash);
OBJSETUP(hash, klass, T_HASH);
- hash->iter_lev = 0;
hash->ifnone = Qnil;
- hash->tbl = 0; /* avoid GC crashing */
hash->tbl = st_copy(RHASH(argv[0])->tbl);
return (VALUE)hash;
@@ -252,9 +248,7 @@ rb_hash_clone(hash)
NEWOBJ(clone, struct RHash);
CLONESETUP(clone, hash);
- clone->iter_lev = 0;
clone->ifnone = RHASH(hash)->ifnone;
- clone->tbl = 0; /* avoid GC crashing */
clone->tbl = (st_table*)st_copy(RHASH(hash)->tbl);
return (VALUE)clone;
diff --git a/lib/cgi.rb b/lib/cgi.rb
index 7f40c3a..1b55f0a 100644
--- a/lib/cgi.rb
+++ b/lib/cgi.rb
@@ -939,7 +939,7 @@ convert string charset, and set language to "ja".
start_pos = lines.rindex(/^\s*<#{element}/ni, end_pos)
lines[start_pos ... end_pos] = "__" + lines[start_pos ... end_pos].gsub(/\n(?!\z)/n, "\n" + shift) + "__"
end
- lines.gsub(/^(\s*)__(?=<\/?\w)/n, '\1')
+ lines.gsub(/^((?:#{Regexp::quote(shift)})*)__(?=<\/?\w)/n, '\1')
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 0d67687..41ffe4c 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -386,7 +386,7 @@ hdrdir = #{$hdrdir}
CC = #{CONFIG["CC"]}
CFLAGS = #{CONFIG["CCDLFLAGS"]} #{CFLAGS} #{$CFLAGS}
-CPPFLAGS = -I$(hdrdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")}
+ CPPFLAGS = -I$(hdrdir) -I#{CONFIG["includedir"]} #{$defs.join(" ")} #{CONFIG["CPPFLAGS"]}
CXXFLAGS = $(CFLAGS)
DLDFLAGS = #{$DLDFLAGS} #{$LDFLAGS}
LDSHARED = #{CONFIG["LDSHARED"]} #{defflag}
@@ -455,6 +455,11 @@ EOMF
$(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
"
+ else
+ mfile.print "
+.c.#{$OBJEXT}:
+ $(CC) $(CFLAGS) $(CPPFLAGS) -c -o $@ $<
+"
end
if CONFIG["DLEXT"] != $OBJEXT
diff --git a/object.c b/object.c
index e4ccf1b..73a24c9 100644
--- a/object.c
+++ b/object.c
@@ -93,7 +93,6 @@ rb_obj_clone(obj)
rb_raise(rb_eTypeError, "can't clone %s", rb_class2name(CLASS_OF(obj)));
}
clone = rb_obj_alloc(RBASIC(obj)->klass);
- ROBJECT(clone)->iv_tbl = 0; /* avoid GC crash */
CLONESETUP(clone,obj);
if (ROBJECT(obj)->iv_tbl) {
ROBJECT(clone)->iv_tbl = st_copy(ROBJECT(obj)->iv_tbl);
@@ -521,8 +520,6 @@ rb_mod_clone(module)
CLONESETUP(clone, module);
clone->super = RCLASS(module)->super;
- clone->iv_tbl = 0;
- clone->m_tbl = 0; /* avoid GC crashing */
if (RCLASS(module)->iv_tbl) {
clone->iv_tbl = st_copy(RCLASS(module)->iv_tbl);
}
diff --git a/ruby.h b/ruby.h
index 11c429f..09f2190 100644
--- a/ruby.h
+++ b/ruby.h
@@ -217,13 +217,12 @@ char *rb_str2cstr _((VALUE,int*));
VALUE rb_newobj _((void));
#define NEWOBJ(obj,type) type *obj = (type*)rb_newobj()
#define OBJSETUP(obj,c,t) {\
- RBASIC(obj)->klass = (c);\
RBASIC(obj)->flags = (t);\
+ RBASIC(obj)->klass = (c);\
if (rb_safe_level() >= 3) FL_SET(obj, FL_TAINT);\
}
#define CLONESETUP(clone,obj) do {\
- RBASIC(clone)->flags = (RBASIC(obj)->flags);\
- RBASIC(obj)->klass = (rb_singleton_class_clone(RBASIC(obj)->klass));\
+ OBJSETUP(clone,rb_singleton_class_clone(RBASIC(obj)->klass),RBASIC(obj)->flags);\
rb_singleton_class_attached(RBASIC(clone)->klass, (VALUE)clone);\
if (FL_TEST(obj, FL_EXIVAR)) rb_clone_generic_ivar((VALUE)clone,(VALUE)obj);\
} while (0)
diff --git a/struct.c b/struct.c
index 977d411..31103a4 100644
--- a/struct.c
+++ b/struct.c
@@ -281,7 +281,6 @@ struct_alloc(argc, argv, klass)
size = iv_get(klass, "__size__");
n = FIX2LONG(size);
- st->len = 0; /* avoid GC crashing */
st->ptr = ALLOC_N(VALUE, n);
rb_mem_clear(st->ptr, n);
st->len = n;
@@ -408,7 +407,6 @@ rb_struct_clone(s)
{
NEWOBJ(clone, struct RStruct);
CLONESETUP(clone, s);
- clone->len = 0; /* avoid GC crashing */
clone->ptr = ALLOC_N(VALUE, RSTRUCT(s)->len);
clone->len = RSTRUCT(s)->len;
MEMCPY(clone->ptr, RSTRUCT(s)->ptr, VALUE, clone->len);
diff --git a/win32/Makefile.sub b/win32/Makefile.sub
index 6840101..ee3f72b 100644
--- a/win32/Makefile.sub
+++ b/win32/Makefile.sub
@@ -29,12 +29,12 @@ AUTOCONF = autoconf
prefix = /usr
-CFLAGS = -nologo -DNT=1 -MDd -Zi
+CFLAGS = -nologo -DNT=1 -Zi -O2b2x -G5
CPPFLAGS = -I$(srcdir) -I$(srcdir)/missing
LDFLAGS = $(CFLAGS) -Fm
XLDFLAGS =
#EXTLIBS =
-LIBS = RubyCRTD.lib user32.lib advapi32.lib ws2_32.lib $(EXTLIBS)
+LIBS = user32.lib advapi32.lib wsock32.lib $(EXTLIBS)
MISSING = crypt.obj alloca.obj win32.obj isinf.obj isnan.obj
LDSHARED =
DLDFLAGS =
diff --git a/win32/config.status.in b/win32/config.status.in
index 37df2b9..2b81802 100644
--- a/win32/config.status.in
+++ b/win32/config.status.in
@@ -1,12 +1,12 @@
s%@SHELL@%%g
-s%@CFLAGS@%-nologo -DNT=1 -MDd -Zi%g
+s%@CFLAGS@%-nologo -DNT=1 -Zi -O2b2x -G5%g
s%@CPPFLAGS@%%g
s%@CXXFLAGS@%%g
s%@FFLAGS@%%g
s%@DEFS@%
-DUSE_THREAD -DSIZEOF_INT=4 -DSIZEOF_SHORT=2 -DSIZEOF_LONG=4 -DSIZEOF_VOIDP=4 -DSIZEOF_FLOAT=4 -DSIZEOF_DOUBLE=8 -DHAVE_PROTOTYPES=1 -DHAVE_STDARG_PROTOTYPES=1 -DHAVE_STDLIB_H=1 -DHAVE_LIMITS_H=1 -DHAVE_FCNTL_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_ST_RDEV=1 -DGETGROUPS_T=int -DRETSIGTYPE=void -DHAVE_ALLOCA=1 -DHAVE_FMOD=1 -DHAVE_WAITPID=1 -DHAVE_GETCWD=1 -DHAVE_CHSIZE=1 -DHAVE_GETGROUPS=1 -DHAVE_GETLOGIN=1 -DRSHIFT=\(x,y\)\ \(\(x\)\>\>y\) -DFILE_COUNT=_cnt -DDLEXT=\".so\" -DDLEXT2=\".dll\" -DRUBY_PLATFORM=\"i586-mswin32\" %g
-s%@LDFLAGS@%-nologo -MDd -Zi%g
-s%@LIBS@%RubyCRTD.lib user32.lib advapi32.lib ws2_32.lib%g
+s%@LDFLAGS@%-nologo%g
+s%@LIBS@%user32.lib advapi32.lib wsock32.lib%g
s%@exec_prefix@%${prefix}%g
s%@prefix@%%g
s%@program_transform_name@%s,x,x,%g
@@ -40,7 +40,7 @@ s%@DEFAULT_KCODE@%%g
s%@EXEEXT@%.exe%g
s%@OBJEXT@%obj%g
s%@XLDFLAGS@%%g
-s%@DLDFLAGS@%-MDd -Zi%g
+s%@DLDFLAGS@%$(CFLAGS)%g
s%@STATIC@%%g
s%@CCDLFLAGS@%-DIMPORT%g
s%@LDSHARED@%cl -LD%g
@@ -59,10 +59,10 @@ s%@LIBRUBY_ALIASES@%%g
s%@LIBRUBY@%$(RUBY_SO_NAME).lib%g
s%@LIBRUBYARG@%$(topdir)/$(RUBY_SO_NAME).lib%g
s%@SOLIBS@%%g
-s%@DLDLIBS@%RubyCRTD.lib%g
+s%@DLDLIBS@%%g
s%@arch@%i586-mswin32%g
s%@sitedir@%${prefix}/lib/ruby/site_ruby%g
-s%@configure_args@%--with-make-prog=nmake --with-tcllib=tcl83 --with-tklib=tk83%g
+s%@configure_args@%--with-make-prog=nmake%g
s%@configure_input@%$configure_input%g
s%@srcdir@%$srcdir%g
s%@top_srcdir@%$top_srcdir%g
diff --git a/win32/resource.rb b/win32/resource.rb
index 3e97688..d25c26e 100644
--- a/win32/resource.rb
+++ b/win32/resource.rb
@@ -8,7 +8,7 @@ fversion = "#{CONFIG['MAJOR']},#{CONFIG['MINOR']},#{CONFIG['TEENY']},0"
$ruby_name ||= CONFIG["RUBY_INSTALL_NAME"]
$rubyw_name ||= CONFIG["RUBYW_INSTALL_NAME"] || $ruby_name.sub(/ruby/, '\&w')
-$so_name ||= CONFIG["RUBY_SO_NAME"]
+$so_name ||= CONFIG["RUBY_SO_NAME"] + '.dll'
icons = {}
def icons.find(path)
@@ -49,7 +49,7 @@ end
[ # base name extension file type icons
[$ruby_name, CONFIG["EXEEXT"], 'VFT_APP', ruby_icon],
[$rubyw_name, CONFIG["EXEEXT"], 'VFT_APP', rubyw_icon],
- [$so_name, '.'+CONFIG["DLEXT2"], 'VFT_DLL', dll_icons],
+ [$so_name, '', 'VFT_DLL', dll_icons],
].each do |base, ext, type, icons|
open(base + '.rc', "w") { |f|
f.binmode if /mingw/ =~ RUBY_PLATFORM