xref: /aosp_15_r20/external/angle/build/rust/tests/bindgen_test/lib.h (revision 8975f5c5ed3d1c378011245431ada316dfb6f244)
1 // Copyright 2022 The Chromium Authors
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef BUILD_RUST_TESTS_BINDGEN_TEST_LIB_H_
6 #define BUILD_RUST_TESTS_BINDGEN_TEST_LIB_H_
7 
8 #include "build/rust/tests/bindgen_test/lib2.h"
9 
10 #include <stdint.h>
11 
12 // The following is equivalent to //base/base_export.h.
13 
14 #if defined(COMPONENT_BUILD)
15 #if defined(WIN32)
16 
17 #if defined(COMPONENT_IMPLEMENTATION)
18 #define COMPONENT_EXPORT __declspec(dllexport)
19 #else
20 #define COMPONENT_EXPORT __declspec(dllimport)
21 #endif  // defined(COMPONENT_IMPLEMENTATION)
22 
23 #else  // defined(WIN32)
24 #if defined(COMPONENT_IMPLEMENTATION)
25 #define COMPONENT_EXPORT __attribute__((visibility("default")))
26 #else
27 #define COMPONENT_EXPORT
28 #endif  // defined(COMPONENT_IMPLEMENTATION)
29 #endif
30 
31 #else  // defined(COMPONENT_BUILD)
32 #define COMPONENT_EXPORT
33 #endif
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 COMPONENT_EXPORT uint32_t add_two_numbers(uint32_t a, uint32_t b);
40 
41 #ifdef __cplusplus
42 }
43 #endif
44 
45 #endif  //  BUILD_RUST_TESTS_BINDGEN_TEST_LIB_H_
46