summaryrefslogtreecommitdiff
path: root/bridges
diff options
context:
space:
mode:
Diffstat (limited to 'bridges')
-rw-r--r--bridges/Library_cpp_uno.mk4
-rw-r--r--bridges/inc/cppinterfaceproxy.hxx5
-rw-r--r--bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx49
-rw-r--r--bridges/source/cpp_uno/msvc_win32_x86-64/dllinit.cxx44
-rw-r--r--bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx24
5 files changed, 4 insertions, 122 deletions
diff --git a/bridges/Library_cpp_uno.mk b/bridges/Library_cpp_uno.mk
index 277c54cf79dc..adb404244319 100644
--- a/bridges/Library_cpp_uno.mk
+++ b/bridges/Library_cpp_uno.mk
@@ -79,7 +79,7 @@ bridge_exception_objects := cpp2uno except uno2cpp
bridge_noncallexception_objects := callvirtualmethod
else ifeq ($(COM),MSC)
bridges_SELECTED_BRIDGE := msvc_win32_intel
-bridge_exception_objects := cpp2uno dllinit uno2cpp
+bridge_exception_objects := cpp2uno uno2cpp
bridge_noopt_objects := except
endif
@@ -174,7 +174,7 @@ bridge_exception_objects := abi call cpp2uno except uno2cpp
bridge_noncallexception_noopt_objects := callvirtualmethod
else ifeq ($(COM),MSC)
bridges_SELECTED_BRIDGE := msvc_win32_x86-64
-bridge_exception_objects := cpp2uno dllinit uno2cpp
+bridge_exception_objects := cpp2uno uno2cpp
bridge_noopt_objects := except
bridge_asm_objects := call
endif
diff --git a/bridges/inc/cppinterfaceproxy.hxx b/bridges/inc/cppinterfaceproxy.hxx
index 4755ea90bced..7d5ab7b167b2 100644
--- a/bridges/inc/cppinterfaceproxy.hxx
+++ b/bridges/inc/cppinterfaceproxy.hxx
@@ -36,11 +36,6 @@ namespace com { namespace sun { namespace star { namespace uno {
class XInterface;
} } } }
-#if !defined __GNUG__
-void dso_init();
-void dso_exit();
-#endif
-
namespace bridges { namespace cpp_uno { namespace shared {
class Bridge;
diff --git a/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx b/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx
deleted file mode 100644
index f65ef74ba4e5..000000000000
--- a/bridges/source/cpp_uno/msvc_win32_intel/dllinit.cxx
+++ /dev/null
@@ -1,49 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#if !defined WIN32_LEAN_AND_MEAN
-# define WIN32_LEAN_AND_MEAN
-#endif
-#include <windows.h>
-
-
-void dso_init();
-void dso_exit();
-
-
-extern "C" BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
-{
- switch(dwReason) {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(hModule);
-
- dso_init();
- break;
-
- case DLL_PROCESS_DETACH:
- if (!lpvReserved)
- dso_exit();
- break;
- }
-
- return TRUE;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/msvc_win32_x86-64/dllinit.cxx b/bridges/source/cpp_uno/msvc_win32_x86-64/dllinit.cxx
deleted file mode 100644
index 8517f0c72674..000000000000
--- a/bridges/source/cpp_uno/msvc_win32_x86-64/dllinit.cxx
+++ /dev/null
@@ -1,44 +0,0 @@
-/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
-/*
- * This file is part of the LibreOffice project.
- *
- * This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/.
- *
- * This file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- */
-
-
-#define WIN32_LEAN_AND_MEAN
-#include <windows.h>
-
-#include <cppinterfaceproxy.hxx>
-
-extern "C" BOOL WINAPI DllMain(HMODULE hModule, DWORD dwReason, LPVOID lpvReserved)
-{
- switch(dwReason) {
- case DLL_PROCESS_ATTACH:
- DisableThreadLibraryCalls(hModule);
-
- dso_init();
- break;
-
- case DLL_PROCESS_DETACH:
- if (!lpvReserved)
- dso_exit();
- break;
- }
-
- return TRUE;
-}
-
-/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
diff --git a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
index 466d83ef46a4..29b035fec3ab 100644
--- a/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
+++ b/bridges/source/cpp_uno/shared/cppinterfaceproxy.cxx
@@ -29,27 +29,6 @@
#include <memory>
#include <new>
-
-static bridges::cpp_uno::shared::VtableFactory * pInstance;
-
-#if defined(__GNUG__)
-extern "C" void dso_init() __attribute__((constructor));
-extern "C" void dso_exit() __attribute__((destructor));
-#endif
-
-void dso_init() {
- if (!pInstance)
- pInstance = new bridges::cpp_uno::shared::VtableFactory();
-}
-
-void dso_exit() {
- if (pInstance)
- {
- delete pInstance;
- pInstance = nullptr;
- }
-}
-
namespace bridges { namespace cpp_uno { namespace shared {
void freeCppInterfaceProxy(uno_ExtEnvironment * pEnv, void * pInterface)
@@ -80,8 +59,9 @@ com::sun::star::uno::XInterface * CppInterfaceProxy::create(
{
typelib_typedescription_complete(
reinterpret_cast< typelib_TypeDescription ** >(&pTypeDescr));
+ static bridges::cpp_uno::shared::VtableFactory factory;
const bridges::cpp_uno::shared::VtableFactory::Vtables& rVtables(
- pInstance->getVtables(pTypeDescr));
+ factory.getVtables(pTypeDescr));
std::unique_ptr< char[] > pMemory(
new char[
sizeof (CppInterfaceProxy)