Files
cbindgen/tests/expectations/assoc_constant.cpp
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

16 lines
193 B
C++

#include <cstdarg>
#include <cstdint>
#include <cstdlib>
struct Foo {
};
static const int32_t Foo_GA = 10;
static const float Foo_ZO = 3.14;
extern "C" {
void root(Foo x);
} // extern "C"