no bug - Import translations from android-l10n r=release a=l10n CLOSED TREE
[gecko.git] / mfbt / SharedLibrary.h
blob8879f033a14ae6aab351dea3a994bc9a66689740
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 /* Path charset agnostic wrappers for prlink.h. */
9 #ifndef mozilla_SharedLibrary_h
10 #define mozilla_SharedLibrary_h
12 #ifdef MOZILLA_INTERNAL_API
14 # include "prlink.h"
15 # include "mozilla/Char16.h"
17 namespace mozilla {
20 // Load the specified library.
22 // @param aPath path to the library
23 // @param aFlags takes PR_LD_* flags (see prlink.h)
25 inline PRLibrary*
26 # ifdef XP_WIN
27 LoadLibraryWithFlags(char16ptr_t aPath, PRUint32 aFlags = 0)
28 # else
29 LoadLibraryWithFlags(const char* aPath, PRUint32 aFlags = 0)
30 # endif
32 PRLibSpec libSpec;
33 # ifdef XP_WIN
34 libSpec.type = PR_LibSpec_PathnameU;
35 libSpec.value.pathname_u = aPath;
36 # else
37 libSpec.type = PR_LibSpec_Pathname;
38 libSpec.value.pathname = aPath;
39 # endif
40 return PR_LoadLibraryWithFlags(libSpec, aFlags);
43 } /* namespace mozilla */
45 #endif /* MOZILLA_INTERNAL_API */
47 #endif /* mozilla_SharedLibrary_h */