From 588504b20f5cc880ad51827b93e571e32446e5db Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 18 Jan 2013 02:23:37 +0000 Subject: win32ole: OLE initialize per threads * ext/win32ole/win32ole.c (ole_initialize): initialize OLE for each threads. [Bug #2618] [ruby-core:27634] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38867 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ext/win32ole/extconf.rb | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ext/win32ole/extconf.rb') diff --git a/ext/win32ole/extconf.rb b/ext/win32ole/extconf.rb index 1a17524d0a..52c3d6bdfb 100644 --- a/ext/win32ole/extconf.rb +++ b/ext/win32ole/extconf.rb @@ -23,6 +23,14 @@ def create_win32ole_makefile unless have_type("IMultiLanguage2", "mlang.h") have_type("IMultiLanguage", "mlang.h") end + spec = nil + checking_for('thread_specific', '%s') do + spec = %w[__declspec(thread) __thread].find {|th| + try_compile("#{th} int foo;", "", :werror => true) + } + spec or 'no' + end + $defs << "-DRB_THREAD_SPECIFIC=#{spec}" if spec create_makefile("win32ole") end end -- cgit v1.2.3