1 // Copyright 2024 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_STATIC_FNS_TEST_LIB_H_ 6 #define BUILD_RUST_TESTS_BINDGEN_STATIC_FNS_TEST_LIB_H_ 7 8 #include <stdint.h> 9 10 // The following is equivalent to //base/base_export.h. 11 12 #if defined(COMPONENT_BUILD) 13 #if defined(WIN32) 14 15 #if defined(COMPONENT_IMPLEMENTATION) 16 #define COMPONENT_EXPORT __declspec(dllexport) 17 #else 18 #define COMPONENT_EXPORT __declspec(dllimport) 19 #endif // defined(COMPONENT_IMPLEMENTATION) 20 21 #else // defined(WIN32) 22 #if defined(COMPONENT_IMPLEMENTATION) 23 #define COMPONENT_EXPORT __attribute__((visibility("default"))) 24 #else 25 #define COMPONENT_EXPORT 26 #endif // defined(COMPONENT_IMPLEMENTATION) 27 #endif 28 29 #else // defined(COMPONENT_BUILD) 30 #define COMPONENT_EXPORT 31 #endif 32 33 #ifdef __cplusplus 34 extern "C" { 35 #endif 36 37 COMPONENT_EXPORT uint32_t mul_two_numbers(uint32_t a, uint32_t b); 38 mul_three_numbers(uint32_t a,uint32_t b,uint32_t c)39[[maybe_unused]] static inline uint32_t mul_three_numbers(uint32_t a, 40 uint32_t b, 41 uint32_t c) { 42 return mul_two_numbers(mul_two_numbers(a, b), c); 43 } 44 45 #ifdef __cplusplus 46 } 47 #endif 48 49 #endif // BUILD_RUST_TESTS_BINDGEN_STATIC_FNS_TEST_LIB_H_ 50