80da1f59aa
Opt-in since it uses a C++17 feature, but this allow exactly the same usage in C++ and Rust, which I think is nice. This also fixes constants of transparent structs in general, since the initial version of this patch broke a test (associated constants in enums), so I added a test for that too.
41 lines
1.3 KiB
C++
41 lines
1.3 KiB
C++
#include <cstdarg>
|
|
#include <cstdint>
|
|
#include <cstdlib>
|
|
|
|
struct DummyStruct;
|
|
|
|
struct EnumWithAssociatedConstantInImpl;
|
|
|
|
using TransparentComplexWrappingStructTuple = DummyStruct;
|
|
|
|
using TransparentPrimitiveWrappingStructTuple = uint32_t;
|
|
|
|
using TransparentComplexWrappingStructure = DummyStruct;
|
|
|
|
using TransparentPrimitiveWrappingStructure = uint32_t;
|
|
|
|
template<typename T>
|
|
using TransparentComplexWrapper = DummyStruct;
|
|
|
|
template<typename T>
|
|
using TransparentPrimitiveWrapper = uint32_t;
|
|
|
|
using TransparentPrimitiveWithAssociatedConstants = uint32_t;
|
|
static const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ZERO = 0;
|
|
static const TransparentPrimitiveWithAssociatedConstants TransparentPrimitiveWithAssociatedConstants_ONE = 1;
|
|
|
|
static const TransparentPrimitiveWrappingStructure EnumWithAssociatedConstantInImpl_TEN = 10;
|
|
|
|
extern "C" {
|
|
|
|
void root(TransparentComplexWrappingStructTuple a,
|
|
TransparentPrimitiveWrappingStructTuple b,
|
|
TransparentComplexWrappingStructure c,
|
|
TransparentPrimitiveWrappingStructure d,
|
|
TransparentComplexWrapper<int32_t> e,
|
|
TransparentPrimitiveWrapper<int32_t> f,
|
|
TransparentPrimitiveWithAssociatedConstants g,
|
|
EnumWithAssociatedConstantInImpl h);
|
|
|
|
} // extern "C"
|