aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ext/-test-/cxxanyargs/extconf.rb2
-rw-r--r--lib/mkmf.rb12
2 files changed, 12 insertions, 2 deletions
diff --git a/ext/-test-/cxxanyargs/extconf.rb b/ext/-test-/cxxanyargs/extconf.rb
index c1823a4042..7e2449a457 100644
--- a/ext/-test-/cxxanyargs/extconf.rb
+++ b/ext/-test-/cxxanyargs/extconf.rb
@@ -1,6 +1,6 @@
# frozen_string_literal: false
-cxx = MakeMakefile::CXX
+cxx = MakeMakefile["C++"]
ok = cxx.try_compile(<<~'begin', "") do |x|
#include "ruby/config.h"
diff --git a/lib/mkmf.rb b/lib/mkmf.rb
index 8df6e9ad59..ce72668501 100644
--- a/lib/mkmf.rb
+++ b/lib/mkmf.rb
@@ -2776,7 +2776,17 @@ distclean: clean distclean-so distclean-static distclean-rb-default distclean-rb
realclean: distclean
"
- module CXX
+ @lang = Hash.new(self)
+
+ def self.[](name)
+ @lang.fetch(name)
+ end
+
+ def self.[]=(name, mod)
+ @lang[name] = mod
+ end
+
+ self["C++"] = Module.new do
include MakeMakefile
extend self