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

ruby-changes:70664

From: Nobuyoshi <ko1@a...>
Date: Thu, 30 Dec 2021 21:14:53 +0900 (JST)
Subject: [ruby-changes:70664] db547a3bc4 (master): [ruby/win32ole] Undefine allocator of WIN32OLE_VARIABLE to get rid of warning

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

From db547a3bc457e55c07880ae5d2d77f55b93775eb Mon Sep 17 00:00:00 2001
From: Nobuyoshi Nakada <nobu@r...>
Date: Tue, 28 Dec 2021 13:54:16 +0900
Subject: [ruby/win32ole] Undefine allocator of WIN32OLE_VARIABLE to get rid of
 warning

https://github.com/ruby/win32ole/commit/27d0fdc622
---
 ext/win32ole/win32ole_variable.c        | 1 +
 test/win32ole/test_win32ole_variable.rb | 4 ++++
 2 files changed, 5 insertions(+)

diff --git a/ext/win32ole/win32ole_variable.c b/ext/win32ole/win32ole_variable.c
index 803083156c8..8d80455d976 100644
--- a/ext/win32ole/win32ole_variable.c
+++ b/ext/win32ole/win32ole_variable.c
@@ -370,6 +370,7 @@ VALUE cWIN32OLE_VARIABLE; https://github.com/ruby/ruby/blob/trunk/ext/win32ole/win32ole_variable.c#L370
 void Init_win32ole_variable(void)
 {
     cWIN32OLE_VARIABLE = rb_define_class("WIN32OLE_VARIABLE", rb_cObject);
+    rb_undef_alloc_func(cWIN32OLE_VARIABLE);
     rb_define_method(cWIN32OLE_VARIABLE, "name", folevariable_name, 0);
     rb_define_method(cWIN32OLE_VARIABLE, "ole_type", folevariable_ole_type, 0);
     rb_define_method(cWIN32OLE_VARIABLE, "ole_type_detail", folevariable_ole_type_detail, 0);
diff --git a/test/win32ole/test_win32ole_variable.rb b/test/win32ole/test_win32ole_variable.rb
index 826029e0a8d..8af3f987a8f 100644
--- a/test/win32ole/test_win32ole_variable.rb
+++ b/test/win32ole/test_win32ole_variable.rb
@@ -16,6 +16,10 @@ if defined?(WIN32OLE_VARIABLE) https://github.com/ruby/ruby/blob/trunk/test/win32ole/test_win32ole_variable.rb#L16
       @var2 = variables.find {|v| v.name == 'UILevel'}
     end
 
+    def test_initialize
+      assert_raise(TypeError) {WIN32OLE_VARIABLE.new}
+    end
+
     def test_name
       assert_equal('ssfDESKTOP', @var1.name)
     end
-- 
cgit v1.2.1


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

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