Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 1 | // 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 | |
Lukasz Anforowicz | 19e057d | 2022-10-28 12:03:23 -0700 | [diff] [blame] | 5 | // Automatically @generated Rust bindings for the following C++ target: |
| 6 | // //rs_bindings_from_cc/test/golden:namespace_cc |
Devin Jeanpierre | 6a3a2d2 | 2023-12-19 16:28:27 -0800 | [diff] [blame] | 7 | // Features: experimental, extern_c, supported |
Lukasz Anforowicz | 19e057d | 2022-10-28 12:03:23 -0700 | [diff] [blame] | 8 | |
Devin Jeanpierre | c19a9a8 | 2023-01-17 14:29:32 -0800 | [diff] [blame] | 9 | #include "support/internal/cxx20_backports.h" |
| 10 | #include "support/internal/offsetof.h" |
Devin Jeanpierre | 1d6cff5 | 2023-05-15 12:15:31 -0700 | [diff] [blame] | 11 | #include "support/internal/sizeof.h" |
Lukasz Anforowicz | 121338a | 2022-11-01 14:28:32 -0700 | [diff] [blame] | 12 | |
Jing Lu | 638ffa7 | 2023-09-28 07:25:59 -0700 | [diff] [blame] | 13 | #include <cstddef> |
| 14 | #include <memory> |
| 15 | |
Lukasz Anforowicz | 121338a | 2022-11-01 14:28:32 -0700 | [diff] [blame] | 16 | // Public headers of the C++ library being wrapped. |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 17 | #include "rs_bindings_from_cc/test/golden/namespace.h" |
| 18 | |
| 19 | #pragma clang diagnostic push |
| 20 | #pragma clang diagnostic ignored "-Wthread-safety-analysis" |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 21 | |
Devin Jeanpierre | 1d6cff5 | 2023-05-15 12:15:31 -0700 | [diff] [blame] | 22 | static_assert(CRUBIT_SIZEOF(struct test_namespace_bindings::S) == 4); |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 23 | static_assert(alignof(struct test_namespace_bindings::S) == 4); |
| 24 | static_assert(CRUBIT_OFFSET_OF(i, struct test_namespace_bindings::S) == 0); |
| 25 | |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 26 | extern "C" void __rust_thunk___ZN23test_namespace_bindings1SC1Ev( |
Lukasz Anforowicz | d4742ff | 2022-07-11 17:05:02 -0700 | [diff] [blame] | 27 | struct test_namespace_bindings::S* __this) { |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 28 | crubit::construct_at(__this); |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 29 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 30 | |
Devin Jeanpierre | 5641325 | 2022-06-02 18:48:24 -0700 | [diff] [blame] | 31 | extern "C" void __rust_thunk___ZN23test_namespace_bindings1SC1EOS0_( |
Lukasz Anforowicz | d4742ff | 2022-07-11 17:05:02 -0700 | [diff] [blame] | 32 | struct test_namespace_bindings::S* __this, |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 33 | struct test_namespace_bindings::S* __param_0) { |
| 34 | crubit::construct_at(__this, std::move(*__param_0)); |
Devin Jeanpierre | 5641325 | 2022-06-02 18:48:24 -0700 | [diff] [blame] | 35 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 36 | |
Googler | 7341f5e | 2023-01-31 14:37:12 -0800 | [diff] [blame] | 37 | extern "C" struct test_namespace_bindings::S* |
| 38 | __rust_thunk___ZN23test_namespace_bindings1SaSERKS0_( |
| 39 | struct test_namespace_bindings::S* __this, |
| 40 | const struct test_namespace_bindings::S* __param_0) { |
| 41 | return &__this->operator=(*__param_0); |
| 42 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 43 | |
Googler | 7341f5e | 2023-01-31 14:37:12 -0800 | [diff] [blame] | 44 | extern "C" struct test_namespace_bindings::S* |
| 45 | __rust_thunk___ZN23test_namespace_bindings1SaSEOS0_( |
| 46 | struct test_namespace_bindings::S* __this, |
| 47 | struct test_namespace_bindings::S* __param_0) { |
| 48 | return &__this->operator=(std::move(*__param_0)); |
| 49 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 50 | |
Lukasz Anforowicz | 81b9687 | 2023-03-17 16:16:32 -0700 | [diff] [blame] | 51 | extern "C" int __rust_thunk___ZN23test_namespace_bindings1fENS_1SE( |
| 52 | struct test_namespace_bindings::S* s) { |
| 53 | return test_namespace_bindings::f(std::move(*s)); |
| 54 | } |
Rosica Dejanovska | a08b386 | 2022-06-02 08:22:49 -0700 | [diff] [blame] | 55 | extern "C" void |
| 56 | __rust_thunk___ZN23test_namespace_bindings15inline_functionEv() { |
| 57 | test_namespace_bindings::inline_function(); |
| 58 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 59 | |
Lukasz Anforowicz | 81b9687 | 2023-03-17 16:16:32 -0700 | [diff] [blame] | 60 | extern "C" void __rust_thunk___Z8identityN23test_namespace_bindings1SE( |
| 61 | struct test_namespace_bindings::S* __return, |
| 62 | struct test_namespace_bindings::S* s) { |
| 63 | new (__return) auto(identity(std::move(*s))); |
| 64 | } |
| 65 | |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 66 | static_assert(sizeof(struct test_namespace_bindings_reopened::inner::S) == 1); |
| 67 | static_assert(alignof(struct test_namespace_bindings_reopened::inner::S) == 1); |
| 68 | |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 69 | extern "C" void __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1Ev( |
Lukasz Anforowicz | d4742ff | 2022-07-11 17:05:02 -0700 | [diff] [blame] | 70 | struct test_namespace_bindings_reopened::inner::S* __this) { |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 71 | crubit::construct_at(__this); |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 72 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 73 | |
Rosica Dejanovska | 6efd17f | 2022-05-11 08:09:57 -0700 | [diff] [blame] | 74 | extern "C" void |
Devin Jeanpierre | 5641325 | 2022-06-02 18:48:24 -0700 | [diff] [blame] | 75 | __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SC1EOS1_( |
Lukasz Anforowicz | d4742ff | 2022-07-11 17:05:02 -0700 | [diff] [blame] | 76 | struct test_namespace_bindings_reopened::inner::S* __this, |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 77 | struct test_namespace_bindings_reopened::inner::S* __param_0) { |
| 78 | crubit::construct_at(__this, std::move(*__param_0)); |
Devin Jeanpierre | 5641325 | 2022-06-02 18:48:24 -0700 | [diff] [blame] | 79 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 80 | |
Googler | 7341f5e | 2023-01-31 14:37:12 -0800 | [diff] [blame] | 81 | extern "C" struct test_namespace_bindings_reopened::inner::S* |
| 82 | __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SaSERKS1_( |
| 83 | struct test_namespace_bindings_reopened::inner::S* __this, |
| 84 | const struct test_namespace_bindings_reopened::inner::S* __param_0) { |
| 85 | return &__this->operator=(*__param_0); |
| 86 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 87 | |
Googler | 7341f5e | 2023-01-31 14:37:12 -0800 | [diff] [blame] | 88 | extern "C" struct test_namespace_bindings_reopened::inner::S* |
| 89 | __rust_thunk___ZN32test_namespace_bindings_reopened5inner1SaSEOS1_( |
| 90 | struct test_namespace_bindings_reopened::inner::S* __this, |
| 91 | struct test_namespace_bindings_reopened::inner::S* __param_0) { |
| 92 | return &__this->operator=(std::move(*__param_0)); |
| 93 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 94 | |
Lukasz Anforowicz | 81b9687 | 2023-03-17 16:16:32 -0700 | [diff] [blame] | 95 | extern "C" void |
| 96 | __rust_thunk___ZN32test_namespace_bindings_reopened5inner1zENS0_1SE( |
| 97 | struct test_namespace_bindings_reopened::inner::S* s) { |
| 98 | test_namespace_bindings_reopened::inner::z(std::move(*s)); |
| 99 | } |
| 100 | |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 101 | static_assert(sizeof(struct test_namespace_bindings_inline::inner:: |
| 102 | StructInInlineNamespace) == 1); |
| 103 | static_assert(alignof(struct test_namespace_bindings_inline::inner:: |
| 104 | StructInInlineNamespace) == 1); |
| 105 | |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 106 | extern "C" void |
| 107 | __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1Ev( |
Lukasz Anforowicz | d4742ff | 2022-07-11 17:05:02 -0700 | [diff] [blame] | 108 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 109 | __this) { |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 110 | crubit::construct_at(__this); |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 111 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 112 | |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 113 | extern "C" void |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 114 | __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceC1EOS1_( |
Lukasz Anforowicz | d4742ff | 2022-07-11 17:05:02 -0700 | [diff] [blame] | 115 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 116 | __this, |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 117 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 118 | __param_0) { |
Lukasz Anforowicz | 07b3390 | 2022-07-13 15:27:03 -0700 | [diff] [blame] | 119 | crubit::construct_at(__this, std::move(*__param_0)); |
Rosica Dejanovska | 4180ffe | 2022-06-09 06:01:05 -0700 | [diff] [blame] | 120 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 121 | |
Googler | 7341f5e | 2023-01-31 14:37:12 -0800 | [diff] [blame] | 122 | extern "C" struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
| 123 | __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceaSERKS1_( |
| 124 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
| 125 | __this, |
| 126 | const struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
| 127 | __param_0) { |
| 128 | return &__this->operator=(*__param_0); |
| 129 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 130 | |
Googler | 7341f5e | 2023-01-31 14:37:12 -0800 | [diff] [blame] | 131 | extern "C" struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
| 132 | __rust_thunk___ZN30test_namespace_bindings_inline5inner23StructInInlineNamespaceaSEOS1_( |
| 133 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
| 134 | __this, |
| 135 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* |
| 136 | __param_0) { |
| 137 | return &__this->operator=(std::move(*__param_0)); |
| 138 | } |
Devin Jeanpierre | 25f9f5a | 2023-03-14 20:39:10 -0700 | [diff] [blame] | 139 | |
Lukasz Anforowicz | 81b9687 | 2023-03-17 16:16:32 -0700 | [diff] [blame] | 140 | extern "C" void |
| 141 | __rust_thunk___Z43useStructInInlineNamespaceWithFullQualifierN30test_namespace_bindings_inline5inner23StructInInlineNamespaceE( |
| 142 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* s) { |
| 143 | useStructInInlineNamespaceWithFullQualifier(std::move(*s)); |
| 144 | } |
| 145 | |
| 146 | extern "C" void |
| 147 | __rust_thunk___Z45useStructInInlineNamespaceSkipInlineQualifierN30test_namespace_bindings_inline5inner23StructInInlineNamespaceE( |
| 148 | struct test_namespace_bindings_inline::inner::StructInInlineNamespace* s) { |
| 149 | useStructInInlineNamespaceSkipInlineQualifier(std::move(*s)); |
| 150 | } |
| 151 | |
Lukasz Anforowicz | 4e2e016 | 2022-09-01 07:07:32 -0700 | [diff] [blame] | 152 | extern "C" void __rust_thunk___ZN4impl3fooEv() { impl::foo(); } |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 153 | |
Rosica Dejanovska | dd9a903 | 2022-04-12 07:34:41 -0700 | [diff] [blame] | 154 | #pragma clang diagnostic pop |