xref: /aoo42x/main/cppu/source/uno/loadmodule.cxx (revision 129fa3d1)
1*129fa3d1SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*129fa3d1SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*129fa3d1SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*129fa3d1SAndrew Rist  * distributed with this work for additional information
6*129fa3d1SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*129fa3d1SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*129fa3d1SAndrew Rist  * "License"); you may not use this file except in compliance
9*129fa3d1SAndrew Rist  * with the License.  You may obtain a copy of the License at
10*129fa3d1SAndrew Rist  *
11*129fa3d1SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12*129fa3d1SAndrew Rist  *
13*129fa3d1SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*129fa3d1SAndrew Rist  * software distributed under the License is distributed on an
15*129fa3d1SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*129fa3d1SAndrew Rist  * KIND, either express or implied.  See the License for the
17*129fa3d1SAndrew Rist  * specific language governing permissions and limitations
18*129fa3d1SAndrew Rist  * under the License.
19*129fa3d1SAndrew Rist  *
20*129fa3d1SAndrew Rist  *************************************************************/
21*129fa3d1SAndrew Rist 
22*129fa3d1SAndrew Rist 
23cdf0e10cSrcweir 
24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove
25cdf0e10cSrcweir #include "precompiled_cppu.hxx"
26cdf0e10cSrcweir 
27cdf0e10cSrcweir #include "sal/config.h"
28cdf0e10cSrcweir 
29cdf0e10cSrcweir #include "osl/module.h"
30cdf0e10cSrcweir #include "rtl/string.h"
31cdf0e10cSrcweir #include "rtl/ustrbuf.hxx"
32cdf0e10cSrcweir #include "rtl/ustring.hxx"
33cdf0e10cSrcweir 
34cdf0e10cSrcweir #include "loadmodule.hxx"
35cdf0e10cSrcweir 
36cdf0e10cSrcweir namespace cppu { namespace detail {
37cdf0e10cSrcweir 
loadModule(rtl::OUString const & name)38cdf0e10cSrcweir ::oslModule loadModule(rtl::OUString const & name) {
39cdf0e10cSrcweir     rtl::OUStringBuffer b;
40cdf0e10cSrcweir #if defined SAL_DLLPREFIX
41cdf0e10cSrcweir     b.appendAscii(RTL_CONSTASCII_STRINGPARAM(SAL_DLLPREFIX));
42cdf0e10cSrcweir #endif
43cdf0e10cSrcweir     b.append(name);
44cdf0e10cSrcweir     b.appendAscii(RTL_CONSTASCII_STRINGPARAM(SAL_DLLEXTENSION));
45cdf0e10cSrcweir     return ::osl_loadModuleRelative(
46cdf0e10cSrcweir         reinterpret_cast< oslGenericFunction >(&loadModule),
47cdf0e10cSrcweir         b.makeStringAndClear().pData,
48cdf0e10cSrcweir         SAL_LOADMODULE_GLOBAL | SAL_LOADMODULE_LAZY);
49cdf0e10cSrcweir }
50cdf0e10cSrcweir 
51cdf0e10cSrcweir } }
52