parser: Treat omitted ABI in extern block as "C".
As per https://doc.rust-lang.org/reference/items/external-blocks.html#abi Closes #709
This commit is contained in:
parent
92f9d3b073
commit
e2114642ae
@ -600,7 +600,7 @@ impl Parse {
|
||||
mod_cfg: Option<&Cfg>,
|
||||
item: &syn::ItemForeignMod,
|
||||
) {
|
||||
if !item.abi.is_c() {
|
||||
if !item.abi.is_c() && !item.abi.is_omitted() {
|
||||
info!("Skip {} - (extern block must be extern C).", crate_name);
|
||||
return;
|
||||
}
|
||||
|
@ -11,3 +11,5 @@ typedef struct {
|
||||
extern int32_t foo(void);
|
||||
|
||||
extern void bar(Normal a);
|
||||
|
||||
extern int32_t baz(void);
|
||||
|
@ -16,6 +16,8 @@ extern int32_t foo(void);
|
||||
|
||||
extern void bar(Normal a);
|
||||
|
||||
extern int32_t baz(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
@ -15,4 +15,6 @@ extern int32_t foo();
|
||||
|
||||
extern void bar(Normal a);
|
||||
|
||||
extern int32_t baz();
|
||||
|
||||
} // extern "C"
|
||||
|
@ -13,3 +13,5 @@ cdef extern from *:
|
||||
extern int32_t foo();
|
||||
|
||||
extern void bar(Normal a);
|
||||
|
||||
extern int32_t baz();
|
||||
|
@ -11,3 +11,5 @@ typedef struct Normal {
|
||||
extern int32_t foo(void);
|
||||
|
||||
extern void bar(struct Normal a);
|
||||
|
||||
extern int32_t baz(void);
|
||||
|
@ -16,6 +16,8 @@ extern int32_t foo(void);
|
||||
|
||||
extern void bar(struct Normal a);
|
||||
|
||||
extern int32_t baz(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
@ -11,3 +11,5 @@ struct Normal {
|
||||
extern int32_t foo(void);
|
||||
|
||||
extern void bar(struct Normal a);
|
||||
|
||||
extern int32_t baz(void);
|
||||
|
@ -16,6 +16,8 @@ extern int32_t foo(void);
|
||||
|
||||
extern void bar(struct Normal a);
|
||||
|
||||
extern int32_t baz(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} // extern "C"
|
||||
#endif // __cplusplus
|
||||
|
@ -13,3 +13,5 @@ cdef extern from *:
|
||||
extern int32_t foo();
|
||||
|
||||
extern void bar(Normal a);
|
||||
|
||||
extern int32_t baz();
|
||||
|
@ -9,3 +9,7 @@ extern "C" {
|
||||
|
||||
fn bar(a: Normal);
|
||||
}
|
||||
|
||||
extern {
|
||||
fn baz() -> i32;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user