| Index: base/native_library_test_library.cc
|
| diff --git a/base/native_library_test_library.cc b/base/native_library_test_library.cc
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..9fd7fe2c75594f78ddef02753c3a765293927b28
|
| --- /dev/null
|
| +++ b/base/native_library_test_library.cc
|
| @@ -0,0 +1,43 @@
|
| +// Copyright 2016 The Chromium Authors. All rights reserved.
|
| +// Use of this source code is governed by a BSD-style license that can be
|
| +// found in the LICENSE file.
|
| +
|
| +#include "build/build_config.h"
|
| +
|
| +#if defined(OS_WIN)
|
| +#define EXPORT __declspec(dllexport)
|
| +#else
|
| +#define EXPORT __attribute__((visibility("default")))
|
| +#endif
|
| +
|
| +extern "C" {
|
| +
|
| +// This variable name must match the exported variable in
|
| +// native_library_unittest.cc.
|
| +int EXPORT g_native_library_exported_value = 0;
|
| +
|
| +int EXPORT GetExportedValue() {
|
| + return g_native_library_exported_value;
|
| +}
|
| +
|
| +void EXPORT SetExportedValue(int value) {
|
| + g_native_library_exported_value = value;
|
| +}
|
| +
|
| +// This function name must match the exported function with the same signature
|
| +// in native_library_unittest.cc. This function must return a different value
|
| +// from the one defined there.
|
| +int EXPORT GetNativeLibraryTestMagicValue() { return 42; }
|
| +
|
| +int EXPORT GetMagicValue() {
|
| + // When called by NativeLibraryTest.LoadLibraryPreferOwnSymbols, this should
|
| + // resolve to the local definition, even though the test module exports
|
| + // another symbol with the same name.
|
| + return GetNativeLibraryTestMagicValue();
|
| +}
|
| +
|
| +int EXPORT GetSimpleTestValue() {
|
| + return 5;
|
| +}
|
| +
|
| +} // extern "C"
|
|
|