summaryrefslogtreecommitdiff
path: root/ext
diff options
context:
space:
mode:
Diffstat (limited to 'ext')
-rw-r--r--ext/-test-/RUBY_ALIGNOF/c.c6
-rw-r--r--ext/-test-/RUBY_ALIGNOF/cpp.cpp6
-rw-r--r--ext/-test-/RUBY_ALIGNOF/extconf.rb4
3 files changed, 10 insertions, 6 deletions
diff --git a/ext/-test-/RUBY_ALIGNOF/c.c b/ext/-test-/RUBY_ALIGNOF/c.c
index 2ff23e1dfd..5768b8c3dd 100644
--- a/ext/-test-/RUBY_ALIGNOF/c.c
+++ b/ext/-test-/RUBY_ALIGNOF/c.c
@@ -7,3 +7,9 @@ struct T {
};
RBIMPL_STATIC_ASSERT(RUBY_ALIGNOF, RUBY_ALIGNOF(double) == offsetof(struct T, t));
+
+void
+Init_RUBY_ALIGNOF()
+{
+ // Windows linker mandates this symbol to exist.
+}
diff --git a/ext/-test-/RUBY_ALIGNOF/cpp.cpp b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
index ea1211c38c..ed76d49b9f 100644
--- a/ext/-test-/RUBY_ALIGNOF/cpp.cpp
+++ b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
@@ -7,9 +7,3 @@ struct T {
};
RBIMPL_STATIC_ASSERT(RUBY_ALIGNOF, RUBY_ALIGNOF(double) == offsetof(T, t));
-
-extern "C" void
-Init_RUBY_ALIGNOF()
-{
- // Windows linker mandates this symbol to exist.
-}
diff --git a/ext/-test-/RUBY_ALIGNOF/extconf.rb b/ext/-test-/RUBY_ALIGNOF/extconf.rb
index ee6500d61e..98a370e987 100644
--- a/ext/-test-/RUBY_ALIGNOF/extconf.rb
+++ b/ext/-test-/RUBY_ALIGNOF/extconf.rb
@@ -1,2 +1,6 @@
# frozen_string_literal: false
+$objs = %W"c.#$OBJEXT"
+
+$objs << "cpp.#$OBJEXT" if MakeMakefile['C++'].have_devel?
+
create_makefile("-test-/RUBY_ALIGNOF")