| OLD | NEW |
| (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" |
| OLD | NEW |