Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(289)

Side by Side Diff: base/native_library_test_library.cc

Issue 2277863002: Enable loading native libraries with RTLD_DEEPBIND (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Enable loading native libraries with RTLD_DEEPBIND Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #include "build/build_config.h"
6
7 #if defined(OS_WIN)
8 #define EXPORT __declspec(dllexport)
9 #else
10 #define EXPORT __attribute__((visibility("default")))
11 #endif
12
13 extern "C" {
14
15 // This variable name must match the exported variable in
16 // native_library_unittest.cc.
17 int EXPORT g_native_library_exported_value = 0;
18
19 int EXPORT GetExportedValue() {
20 return g_native_library_exported_value;
21 }
22
23 void EXPORT SetExportedValue(int value) {
24 g_native_library_exported_value = value;
25 }
26
27 // This function name must match the exported function with the same signature
28 // in native_library_unittest.cc. This function must return a different value
29 // from the one defined there.
30 int EXPORT GetNativeLibraryTestMagicValue() { return 42; }
31
32 int EXPORT GetMagicValue() {
33 // When called by NativeLibraryTest.LoadLibraryPreferOwnSymbols, this should
34 // resolve to the local definition, even though the test module exports
35 // another symbol with the same name.
36 return GetNativeLibraryTestMagicValue();
37 }
38
39 int EXPORT GetSimpleTestValue() {
40 return 5;
41 }
42
43 } // extern "C"
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698