Skip to content

Commit

Permalink
fix: Declare explicit ABI on extern block
Browse files Browse the repository at this point in the history
  • Loading branch information
JohnTitor committed Feb 5, 2025
1 parent d375f7f commit de367e8
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1294,7 +1294,7 @@ impl<'a> Generator<'a> {
t!(writeln!(
self.rust,
r#"
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_offset_{ty}_{field}() -> u64;
#[allow(non_snake_case)]
Expand Down Expand Up @@ -1347,7 +1347,7 @@ impl<'a> Generator<'a> {
t!(writeln!(
self.rust,
r#"
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_field_type_{ty}_{field}(a: *mut {ty})
-> *mut u8;
Expand Down Expand Up @@ -1402,7 +1402,7 @@ impl<'a> Generator<'a> {
#[allow(non_snake_case)]
#[inline(never)]
fn size_align_{ty}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_size_{ty}() -> u64;
#[allow(non_snake_case)]
Expand Down Expand Up @@ -1467,7 +1467,7 @@ impl<'a> Generator<'a> {
#[inline(never)]
#[allow(non_snake_case)]
fn sign_{ty}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_signed_{ty}() -> u32;
}}
Expand Down Expand Up @@ -1533,7 +1533,7 @@ impl<'a> Generator<'a> {
#[inline(never)]
#[allow(non_snake_case)]
fn const_{name}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_const_{name}() -> *const *const u8;
}}
Expand All @@ -1554,7 +1554,7 @@ impl<'a> Generator<'a> {
r#"
#[allow(non_snake_case)]
fn const_{name}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_const_{name}() -> *const {ty};
}}
Expand Down Expand Up @@ -1661,7 +1661,7 @@ impl<'a> Generator<'a> {
#[allow(non_snake_case)]
#[inline(never)]
fn fn_{name}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_fn_{name}() -> *mut u32;
}}
Expand Down Expand Up @@ -1719,7 +1719,7 @@ impl<'a> Generator<'a> {
#[inline(never)]
#[allow(non_snake_case)]
fn static_{name}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_static_{name}() -> {ty};
}}
Expand Down Expand Up @@ -1764,7 +1764,7 @@ impl<'a> Generator<'a> {
#[inline(never)]
#[allow(non_snake_case)]
fn static_{name}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_static_{name}() -> *{mutbl} {ty};
}}
Expand Down Expand Up @@ -1809,7 +1809,7 @@ impl<'a> Generator<'a> {
#[allow(non_snake_case)]
#[inline(never)]
fn static_{name}() {{
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_static_{name}() -> *{mutbl} {ty};
}}
Expand Down Expand Up @@ -1991,7 +1991,7 @@ impl<'a> Generator<'a> {
use libc::c_int;
type U = {ty};
#[allow(improper_ctypes)]
extern {{
extern "C" {{
#[allow(non_snake_case)]
fn __test_roundtrip_{ty}(
size: i32, x: U, e: *mut c_int, pad: *const u8
Expand Down

0 comments on commit de367e8

Please sign in to comment.