Skip to content

Commit

Permalink
Update tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vanillajonathan committed Apr 15, 2024
1 parent b197547 commit d76a30f
Show file tree
Hide file tree
Showing 328 changed files with 1,062 additions and 1,008 deletions.
4 changes: 2 additions & 2 deletions docs.md
Expand Up @@ -474,13 +474,13 @@ no_includes = false
#
# #ifdef __cplusplus
# extern "C" {
# #endif // __cplusplus
# #endif // __cplusplus
#
# // Generated functions.
#
# #ifdef __cplusplus
# } // extern "C"
# #endif // __cplusplus
# #endif // __cplusplus
#
# If the language is not C this option won't have any effect.
#
Expand Down
4 changes: 2 additions & 2 deletions src/bindgen/ir/enumeration.rs
Expand Up @@ -668,7 +668,7 @@ impl Enum {
out.new_line();
write!(out, " : {}", prim);
out.new_line();
out.write("#endif // __cplusplus");
out.write("#endif // __cplusplus");
out.new_line();
}
} else {
Expand Down Expand Up @@ -756,7 +756,7 @@ impl Enum {

if config.cpp_compatible_c() {
out.new_line_if_not_start();
out.write("#endif // __cplusplus");
out.write("#endif // __cplusplus");
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/bindgen/language_backend/clike.rs
Expand Up @@ -963,7 +963,7 @@ impl LanguageBackend for CLikeLanguageBackend<'_> {
}

if b.config.cpp_compatible_c() {
out.write("#endif // __cplusplus");
out.write("#endif // __cplusplus");
out.new_line();
}

Expand Down
4 changes: 2 additions & 2 deletions tests/expectations/abi_string.compat.c
Expand Up @@ -5,12 +5,12 @@

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void c(void);

void c_unwind(void);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
8 changes: 4 additions & 4 deletions tests/expectations/alias.compat.c
Expand Up @@ -6,14 +6,14 @@
enum Status
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
#endif // __cplusplus
{
Ok,
Err,
};
#ifndef __cplusplus
typedef uint32_t Status;
#endif // __cplusplus
#endif // __cplusplus

typedef struct {
int32_t a;
Expand Down Expand Up @@ -42,10 +42,10 @@ typedef Status SpecialStatus;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
8 changes: 4 additions & 4 deletions tests/expectations/alias_both.compat.c
Expand Up @@ -6,14 +6,14 @@
enum Status
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
#endif // __cplusplus
{
Ok,
Err,
};
#ifndef __cplusplus
typedef uint32_t Status;
#endif // __cplusplus
#endif // __cplusplus

typedef struct Dep {
int32_t a;
Expand Down Expand Up @@ -42,10 +42,10 @@ typedef Status SpecialStatus;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
8 changes: 4 additions & 4 deletions tests/expectations/alias_tag.compat.c
Expand Up @@ -6,14 +6,14 @@
enum Status
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
#endif // __cplusplus
{
Ok,
Err,
};
#ifndef __cplusplus
typedef uint32_t Status;
#endif // __cplusplus
#endif // __cplusplus

struct Dep {
int32_t a;
Expand Down Expand Up @@ -42,10 +42,10 @@ typedef Status SpecialStatus;

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(IntFoo x, DoubleFoo y, Unit z, SpecialStatus w);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
16 changes: 8 additions & 8 deletions tests/expectations/annotation.compat.c
Expand Up @@ -6,14 +6,14 @@
enum C
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
#endif // __cplusplus
{
X = 2,
Y,
};
#ifndef __cplusplus
typedef uint32_t C;
#endif // __cplusplus
#endif // __cplusplus

typedef struct {
int32_t m0;
Expand All @@ -27,15 +27,15 @@ typedef struct {
enum F_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
#endif // __cplusplus
{
Foo,
Bar,
Baz,
};
#ifndef __cplusplus
typedef uint8_t F_Tag;
#endif // __cplusplus
#endif // __cplusplus

typedef struct {
F_Tag tag;
Expand All @@ -55,15 +55,15 @@ typedef union {
enum H_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
#endif // __cplusplus
{
Hello,
There,
Everyone,
};
#ifndef __cplusplus
typedef uint8_t H_Tag;
#endif // __cplusplus
#endif // __cplusplus

typedef struct {
uint8_t x;
Expand All @@ -82,10 +82,10 @@ typedef struct {

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(A x, B y, C z, F f, H h);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
16 changes: 8 additions & 8 deletions tests/expectations/annotation_both.compat.c
Expand Up @@ -6,14 +6,14 @@
enum C
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
#endif // __cplusplus
{
X = 2,
Y,
};
#ifndef __cplusplus
typedef uint32_t C;
#endif // __cplusplus
#endif // __cplusplus

typedef struct A {
int32_t m0;
Expand All @@ -27,15 +27,15 @@ typedef struct B {
enum F_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
#endif // __cplusplus
{
Foo,
Bar,
Baz,
};
#ifndef __cplusplus
typedef uint8_t F_Tag;
#endif // __cplusplus
#endif // __cplusplus

typedef struct Bar_Body {
F_Tag tag;
Expand All @@ -55,15 +55,15 @@ typedef union F {
enum H_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
#endif // __cplusplus
{
Hello,
There,
Everyone,
};
#ifndef __cplusplus
typedef uint8_t H_Tag;
#endif // __cplusplus
#endif // __cplusplus

typedef struct There_Body {
uint8_t x;
Expand All @@ -82,10 +82,10 @@ typedef struct H {

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(struct A x, struct B y, C z, union F f, struct H h);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
16 changes: 8 additions & 8 deletions tests/expectations/annotation_tag.compat.c
Expand Up @@ -6,14 +6,14 @@
enum C
#ifdef __cplusplus
: uint32_t
#endif // __cplusplus
#endif // __cplusplus
{
X = 2,
Y,
};
#ifndef __cplusplus
typedef uint32_t C;
#endif // __cplusplus
#endif // __cplusplus

struct A {
int32_t m0;
Expand All @@ -27,15 +27,15 @@ struct B {
enum F_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
#endif // __cplusplus
{
Foo,
Bar,
Baz,
};
#ifndef __cplusplus
typedef uint8_t F_Tag;
#endif // __cplusplus
#endif // __cplusplus

struct Bar_Body {
F_Tag tag;
Expand All @@ -55,15 +55,15 @@ union F {
enum H_Tag
#ifdef __cplusplus
: uint8_t
#endif // __cplusplus
#endif // __cplusplus
{
Hello,
There,
Everyone,
};
#ifndef __cplusplus
typedef uint8_t H_Tag;
#endif // __cplusplus
#endif // __cplusplus

struct There_Body {
uint8_t x;
Expand All @@ -82,10 +82,10 @@ struct H {

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(struct A x, struct B y, C z, union F f, struct H h);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/array.compat.c
Expand Up @@ -18,10 +18,10 @@ typedef struct {

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(Foo a);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/array_both.compat.c
Expand Up @@ -18,10 +18,10 @@ typedef struct Foo {

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(struct Foo a);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus
4 changes: 2 additions & 2 deletions tests/expectations/array_tag.compat.c
Expand Up @@ -18,10 +18,10 @@ struct Foo {

#ifdef __cplusplus
extern "C" {
#endif // __cplusplus
#endif // __cplusplus

void root(struct Foo a);

#ifdef __cplusplus
} // extern "C"
#endif // __cplusplus
#endif // __cplusplus

0 comments on commit d76a30f

Please sign in to comment.