[前][次][番号順一覧][スレッド一覧]

ruby-changes:63091

From: =E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3 <ko1@a...>
Date: Fri, 25 Sep 2020 11:39:00 +0900 (JST)
Subject: [ruby-changes:63091] 4cc501bcfd (master): ext/-test-/RUBY_ALIGNOF: skip C++ when no compiler

https://git.ruby-lang.org/ruby.git/commit/?id=4cc501bcfd

From 4cc501bcfd23691c5244877f9d088a6be6bc8e13 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E5=8D=9C=E9=83=A8=E6=98=8C=E5=B9=B3?=
 <shyouhei@r...>
Date: Thu, 24 Sep 2020 12:16:31 +0900
Subject: ext/-test-/RUBY_ALIGNOF: skip C++ when no compiler

C++ compilers are optional.  Skip C++ tests when they are absent.

diff --git a/ext/-test-/RUBY_ALIGNOF/c.c b/ext/-test-/RUBY_ALIGNOF/c.c
index 2ff23e1..5768b8c 100644
--- a/ext/-test-/RUBY_ALIGNOF/c.c
+++ b/ext/-test-/RUBY_ALIGNOF/c.c
@@ -7,3 +7,9 @@ struct T { https://github.com/ruby/ruby/blob/trunk/ext/-test-/RUBY_ALIGNOF/c.c#L7
 };
 
 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 ea1211c..ed76d49 100644
--- a/ext/-test-/RUBY_ALIGNOF/cpp.cpp
+++ b/ext/-test-/RUBY_ALIGNOF/cpp.cpp
@@ -7,9 +7,3 @@ struct T { https://github.com/ruby/ruby/blob/trunk/ext/-test-/RUBY_ALIGNOF/cpp.cpp#L7
 };
 
 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 ee6500d..98a370e 100644
--- a/ext/-test-/RUBY_ALIGNOF/extconf.rb
+++ b/ext/-test-/RUBY_ALIGNOF/extconf.rb
@@ -1,2 +1,6 @@ https://github.com/ruby/ruby/blob/trunk/ext/-test-/RUBY_ALIGNOF/extconf.rb#L1
 # frozen_string_literal: false
+$objs = %W"c.#$OBJEXT"
+
+$objs << "cpp.#$OBJEXT" if MakeMakefile['C++'].have_devel?
+
 create_makefile("-test-/RUBY_ALIGNOF")
-- 
cgit v0.10.2


--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]