Files
cbindgen/tests/expectations/both/transparent.c
T
Emilio Cobos Álvarez 80da1f59aa Allow to generate associated constants in the body of C++ structs.
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.
2019-02-23 17:58:22 -08:00

36 lines
1.1 KiB
C

#include <stdarg.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
typedef struct DummyStruct DummyStruct;
typedef struct EnumWithAssociatedConstantInImpl EnumWithAssociatedConstantInImpl;
typedef DummyStruct TransparentComplexWrappingStructTuple;
typedef uint32_t TransparentPrimitiveWrappingStructTuple;
typedef DummyStruct TransparentComplexWrappingStructure;
typedef uint32_t TransparentPrimitiveWrappingStructure;
typedef DummyStruct TransparentComplexWrapper_i32;
typedef uint32_t TransparentPrimitiveWrapper_i32;
typedef uint32_t TransparentPrimitiveWithAssociatedConstants;
#define TransparentPrimitiveWithAssociatedConstants_ZERO 0
#define TransparentPrimitiveWithAssociatedConstants_ONE 1
#define EnumWithAssociatedConstantInImpl_TEN 10
void root(TransparentComplexWrappingStructTuple a,
TransparentPrimitiveWrappingStructTuple b,
TransparentComplexWrappingStructure c,
TransparentPrimitiveWrappingStructure d,
TransparentComplexWrapper_i32 e,
TransparentPrimitiveWrapper_i32 f,
TransparentPrimitiveWithAssociatedConstants g,
EnumWithAssociatedConstantInImpl h);