xref: /aosp_15_r20/external/libchrome/base/profiler/test_support_library.cc (revision 635a864187cb8b6c713ff48b7e790a6b21769273)
1 // Copyright 2015 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 // Note: there is intentionally no header file associated with this library so
6 // we don't risk implicitly demand loading it by accessing a symbol.
7 
8 #if defined(WIN32)
9 #define BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT __declspec(dllexport)
10 #else  // defined(WIN32)
11 #define BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT __attribute__((visibility("default")))
12 #endif
13 
14 namespace base {
15 
16 // Must be defined in an extern "C" block so we can look up the unmangled name.
17 extern "C" {
18 
InvokeCallbackFunction(void (* function)(void *),void * arg)19 BASE_PROFILER_TEST_SUPPORT_LIBRARY_EXPORT void InvokeCallbackFunction(
20     void (*function)(void*),
21     void* arg) {
22   function(arg);
23   // Prevent tail call.
24   volatile int i = 0;
25   i = 1;
26 }
27 
28 }  // extern "C"
29 
30 }  // namespace base
31