blob: 311de170946604a4f720e1a566cd517d046deadb [file] [log] [blame]
Devin Jeanpierre27450132022-04-11 13:52:01 -07001// Part of the Crubit project, under the Apache License v2.0 with LLVM
2// Exceptions. See /LICENSE for license information.
3// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
4#ifndef THIRD_PARTY_CRUBIT_RS_BINDINGS_FROM_CC_TEST_STRUCT_FORWARD_DECLARATIONS_DEFINITION_H_
5#define THIRD_PARTY_CRUBIT_RS_BINDINGS_FROM_CC_TEST_STRUCT_FORWARD_DECLARATIONS_DEFINITION_H_
6
7#pragma clang lifetime_elision
8
9struct UnpinStruct final {
10 UnpinStruct() = default;
Devin Jeanpierrec0543eb2022-04-20 16:00:34 -070011 UnpinStruct(int value) : field(value) {}
Devin Jeanpierre27450132022-04-11 13:52:01 -070012 int field = 0;
13};
14
Devin Jeanpierreaf292f82022-04-11 13:53:30 -070015struct NonunpinStruct /* non-final */ {
16 NonunpinStruct() = default;
Devin Jeanpierrec0543eb2022-04-20 16:00:34 -070017 NonunpinStruct(int value) : field(value) {}
Devin Jeanpierreaf292f82022-04-11 13:53:30 -070018 int field = 0;
19};
20
Devin Jeanpierrec0543eb2022-04-20 16:00:34 -070021int ReadUnpinStruct(const UnpinStruct& s);
22void WriteUnpinStruct(UnpinStruct& s, int value);
23int ReadNonunpinStruct(const NonunpinStruct& s);
24void WriteNonunpinStruct(NonunpinStruct& s, int value);
Devin Jeanpierreaf292f82022-04-11 13:53:30 -070025
Devin Jeanpierre27450132022-04-11 13:52:01 -070026#endif // THIRD_PARTY_CRUBIT_RS_BINDINGS_FROM_CC_TEST_STRUCT_FORWARD_DECLARATIONS_DEFINITION_H_