diff --git a/tests/expectations/enum.both.c b/tests/expectations/enum.both.c index a42de0d..e4de60f 100644 --- a/tests/expectations/enum.both.c +++ b/tests/expectations/enum.both.c @@ -129,27 +129,27 @@ typedef struct H { }; } H; -enum I_Tag { - I_Foo, - I_Bar, - I_Baz, +enum ExI_Tag { + ExI_Foo, + ExI_Bar, + ExI_Baz, }; -typedef uint8_t I_Tag; +typedef uint8_t ExI_Tag; -typedef struct I_Bar_Body { +typedef struct ExI_Bar_Body { uint8_t x; int16_t y; -} I_Bar_Body; +} ExI_Bar_Body; -typedef struct I { - I_Tag tag; +typedef struct ExI { + ExI_Tag tag; union { struct { int16_t foo; }; - I_Bar_Body bar; + ExI_Bar_Body bar; }; -} I; +} ExI; enum P_Tag { P0, @@ -182,7 +182,7 @@ void root(struct Opaque *opaque, F f, union G g, struct H h, - struct I i, + struct ExI i, struct J j, struct K k, enum L l, diff --git a/tests/expectations/enum.both.compat.c b/tests/expectations/enum.both.compat.c index 5378b67..d34fc19 100644 --- a/tests/expectations/enum.both.compat.c +++ b/tests/expectations/enum.both.compat.c @@ -183,33 +183,33 @@ typedef struct H { }; } H; -enum I_Tag +enum ExI_Tag #ifdef __cplusplus : uint8_t #endif // __cplusplus { - I_Foo, - I_Bar, - I_Baz, + ExI_Foo, + ExI_Bar, + ExI_Baz, }; #ifndef __cplusplus -typedef uint8_t I_Tag; +typedef uint8_t ExI_Tag; #endif // __cplusplus -typedef struct I_Bar_Body { +typedef struct ExI_Bar_Body { uint8_t x; int16_t y; -} I_Bar_Body; +} ExI_Bar_Body; -typedef struct I { - I_Tag tag; +typedef struct ExI { + ExI_Tag tag; union { struct { int16_t foo; }; - I_Bar_Body bar; + ExI_Bar_Body bar; }; -} I; +} ExI; enum P_Tag #ifdef __cplusplus @@ -252,7 +252,7 @@ void root(struct Opaque *opaque, F f, union G g, struct H h, - struct I i, + struct ExI i, struct J j, struct K k, enum L l, diff --git a/tests/expectations/enum.c b/tests/expectations/enum.c index bc94647..f747c88 100644 --- a/tests/expectations/enum.c +++ b/tests/expectations/enum.c @@ -129,27 +129,27 @@ typedef struct { }; } H; -enum I_Tag { - I_Foo, - I_Bar, - I_Baz, +enum ExI_Tag { + ExI_Foo, + ExI_Bar, + ExI_Baz, }; -typedef uint8_t I_Tag; +typedef uint8_t ExI_Tag; typedef struct { uint8_t x; int16_t y; -} I_Bar_Body; +} ExI_Bar_Body; typedef struct { - I_Tag tag; + ExI_Tag tag; union { struct { int16_t foo; }; - I_Bar_Body bar; + ExI_Bar_Body bar; }; -} I; +} ExI; enum P_Tag { P0, @@ -182,7 +182,7 @@ void root(Opaque *opaque, F f, G g, H h, - I i, + ExI i, J j, K k, L l, diff --git a/tests/expectations/enum.compat.c b/tests/expectations/enum.compat.c index 5829c6b..2ccfa7a 100644 --- a/tests/expectations/enum.compat.c +++ b/tests/expectations/enum.compat.c @@ -183,33 +183,33 @@ typedef struct { }; } H; -enum I_Tag +enum ExI_Tag #ifdef __cplusplus : uint8_t #endif // __cplusplus { - I_Foo, - I_Bar, - I_Baz, + ExI_Foo, + ExI_Bar, + ExI_Baz, }; #ifndef __cplusplus -typedef uint8_t I_Tag; +typedef uint8_t ExI_Tag; #endif // __cplusplus typedef struct { uint8_t x; int16_t y; -} I_Bar_Body; +} ExI_Bar_Body; typedef struct { - I_Tag tag; + ExI_Tag tag; union { struct { int16_t foo; }; - I_Bar_Body bar; + ExI_Bar_Body bar; }; -} I; +} ExI; enum P_Tag #ifdef __cplusplus @@ -252,7 +252,7 @@ void root(Opaque *opaque, F f, G g, H h, - I i, + ExI i, J j, K k, L l, diff --git a/tests/expectations/enum.cpp b/tests/expectations/enum.cpp index b3f15b1..a693939 100644 --- a/tests/expectations/enum.cpp +++ b/tests/expectations/enum.cpp @@ -127,26 +127,26 @@ struct H { }; }; -struct I { +struct ExI { enum class Tag : uint8_t { - I_Foo, - I_Bar, - I_Baz, + ExI_Foo, + ExI_Bar, + ExI_Baz, }; - struct I_Foo_Body { + struct ExI_Foo_Body { int16_t _0; }; - struct I_Bar_Body { + struct ExI_Bar_Body { uint8_t x; int16_t y; }; Tag tag; union { - I_Foo_Body foo; - I_Bar_Body bar; + ExI_Foo_Body foo; + ExI_Bar_Body bar; }; }; @@ -184,7 +184,7 @@ void root(Opaque *opaque, F f, G g, H h, - I i, + ExI i, J j, K k, L l, diff --git a/tests/expectations/enum.pyx b/tests/expectations/enum.pyx index e410d81..14b648e 100644 --- a/tests/expectations/enum.pyx +++ b/tests/expectations/enum.pyx @@ -114,19 +114,19 @@ cdef extern from *: H_Bar_Body bar; cdef enum: - I_Foo, - I_Bar, - I_Baz, - ctypedef uint8_t I_Tag; + ExI_Foo, + ExI_Bar, + ExI_Baz, + ctypedef uint8_t ExI_Tag; - ctypedef struct I_Bar_Body: + ctypedef struct ExI_Bar_Body: uint8_t x; int16_t y; - ctypedef struct I: - I_Tag tag; + ctypedef struct ExI: + ExI_Tag tag; int16_t foo; - I_Bar_Body bar; + ExI_Bar_Body bar; cdef enum: P0, @@ -152,7 +152,7 @@ cdef extern from *: F f, G g, H h, - I i, + ExI i, J j, K k, L l, diff --git a/tests/expectations/enum.tag.c b/tests/expectations/enum.tag.c index 019d4b9..ca734ba 100644 --- a/tests/expectations/enum.tag.c +++ b/tests/expectations/enum.tag.c @@ -129,25 +129,25 @@ struct H { }; }; -enum I_Tag { - I_Foo, - I_Bar, - I_Baz, +enum ExI_Tag { + ExI_Foo, + ExI_Bar, + ExI_Baz, }; -typedef uint8_t I_Tag; +typedef uint8_t ExI_Tag; -struct I_Bar_Body { +struct ExI_Bar_Body { uint8_t x; int16_t y; }; -struct I { - I_Tag tag; +struct ExI { + ExI_Tag tag; union { struct { int16_t foo; }; - struct I_Bar_Body bar; + struct ExI_Bar_Body bar; }; }; @@ -182,7 +182,7 @@ void root(struct Opaque *opaque, F f, union G g, struct H h, - struct I i, + struct ExI i, struct J j, struct K k, enum L l, diff --git a/tests/expectations/enum.tag.compat.c b/tests/expectations/enum.tag.compat.c index 890ba71..71b543c 100644 --- a/tests/expectations/enum.tag.compat.c +++ b/tests/expectations/enum.tag.compat.c @@ -183,31 +183,31 @@ struct H { }; }; -enum I_Tag +enum ExI_Tag #ifdef __cplusplus : uint8_t #endif // __cplusplus { - I_Foo, - I_Bar, - I_Baz, + ExI_Foo, + ExI_Bar, + ExI_Baz, }; #ifndef __cplusplus -typedef uint8_t I_Tag; +typedef uint8_t ExI_Tag; #endif // __cplusplus -struct I_Bar_Body { +struct ExI_Bar_Body { uint8_t x; int16_t y; }; -struct I { - I_Tag tag; +struct ExI { + ExI_Tag tag; union { struct { int16_t foo; }; - struct I_Bar_Body bar; + struct ExI_Bar_Body bar; }; }; @@ -252,7 +252,7 @@ void root(struct Opaque *opaque, F f, union G g, struct H h, - struct I i, + struct ExI i, struct J j, struct K k, enum L l, diff --git a/tests/expectations/enum.tag.pyx b/tests/expectations/enum.tag.pyx index bc956a7..e74be33 100644 --- a/tests/expectations/enum.tag.pyx +++ b/tests/expectations/enum.tag.pyx @@ -114,19 +114,19 @@ cdef extern from *: H_Bar_Body bar; cdef enum: - I_Foo, - I_Bar, - I_Baz, - ctypedef uint8_t I_Tag; + ExI_Foo, + ExI_Bar, + ExI_Baz, + ctypedef uint8_t ExI_Tag; - cdef struct I_Bar_Body: + cdef struct ExI_Bar_Body: uint8_t x; int16_t y; - cdef struct I: - I_Tag tag; + cdef struct ExI: + ExI_Tag tag; int16_t foo; - I_Bar_Body bar; + ExI_Bar_Body bar; cdef enum: P0, @@ -152,7 +152,7 @@ cdef extern from *: F f, G g, H h, - I i, + ExI i, J j, K k, L l, diff --git a/tests/rust/enum.toml b/tests/rust/enum.toml index 807507b..dd2dd79 100644 --- a/tests/rust/enum.toml +++ b/tests/rust/enum.toml @@ -14,3 +14,6 @@ static_assert(sizeof(CBINDGEN_STRUCT(P)) == 4, "unexpected size for P"); ' ''' #endif """ + +[export.rename] +"I" = "ExI"