summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-25 06:29:27 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2000-12-25 06:29:27 +0000
commit99020d6e50702eb371111d73280eb80b4b29ba5b (patch)
treef2ec985d66f5d99a203277cf0961d960228d441e /lib
parent8f6673c2d4a7e6ff470b584141c590e4b066f5e2 (diff)
001225
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@1075 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r--lib/date.rb1
-rw-r--r--lib/mkmf.rb6
-rw-r--r--lib/singleton.rb4
3 files changed, 6 insertions, 5 deletions
diff --git a/lib/date.rb b/lib/date.rb
index 4abf75f..58179a7 100644
--- a/lib/date.rb
+++ b/lib/date.rb
@@ -202,6 +202,7 @@ class Date
for id in ids
module_eval <<-"end;"
alias_method :__#{id.to_i}__, :#{id.id2name}
+ private :__#{id.to_i}__
def #{id.id2name}(*args, &block)
(@__#{id.to_i}__ ||= [__#{id.to_i}__(*args, &block)])[0]
end
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 788a957..317200b 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -44,7 +44,7 @@ else
end
LINK = "#{CONFIG['CC']} -o conftest -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s #{CONFIG['LDFLAGS']} %s conftest.c %s %s #{CONFIG['LIBS']}"
-CPP = "#{CONFIG['CPP']} -E -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"
+CPP = "#{CONFIG['CPP']} -E %s -I#{$hdrdir} #{CFLAGS} -I#{CONFIG['includedir']} %s %s conftest.c"
def rm_f(*files)
targets = []
@@ -104,7 +104,7 @@ def try_cpp(src, opt="")
cfile.print src
cfile.close
begin
- xsystem(format(CPP, $CFLAGS, opt))
+ xsystem(format(CPP, $CPPFLAGS, $CFLAGS, opt))
ensure
rm_f "conftest*"
end
@@ -115,7 +115,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}", $CPPFLAGS, $CFLAGS, opt))
ensure
rm_f "conftest*"
end
diff --git a/lib/singleton.rb b/lib/singleton.rb
index 235ba89..aa245b3 100644
--- a/lib/singleton.rb
+++ b/lib/singleton.rb
@@ -16,10 +16,10 @@ module Singleton
klass.instance_eval %{
@__instance__ = nil
def instance
- Thread.critical = true
unless @__instance__
+ Thread.critical = true
begin
- @__instance__ = new
+ @__instance__ ||= new
ensure
Thread.critical = false
end