Skip to content

Commit 2d26ab5

Browse files
committed
Explicitly state ABI on exports
Not releated to the edition bump but I've been getting warnings about these for a while (maybe rustc update) - using the default=C has been deprecated
1 parent 7e929bf commit 2d26ab5

6 files changed

Lines changed: 14 additions & 14 deletions

File tree

  • tests/modules

tests/modules/rust_wasm32_counter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ pub struct Value {
2121
static COUNTER: Lazy<RelaxedCounter> = Lazy::new(|| RelaxedCounter::new(0));
2222

2323
#[unsafe(no_mangle)]
24-
pub extern fn alloc(size: usize) -> *mut u8 {
24+
pub extern "C" fn alloc(size: usize) -> *mut u8 {
2525
lens_sdk::alloc(size)
2626
}
2727

2828
#[unsafe(no_mangle)]
29-
pub extern fn transform() -> *mut u8 {
29+
pub extern "C" fn transform() -> *mut u8 {
3030
match try_transform() {
3131
Ok(o) => match o {
3232
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json),

tests/modules/rust_wasm32_filter/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,12 +17,12 @@ pub struct Value {
1717
}
1818

1919
#[unsafe(no_mangle)]
20-
pub extern fn alloc(size: usize) -> *mut u8 {
20+
pub extern "C" fn alloc(size: usize) -> *mut u8 {
2121
lens_sdk::alloc(size)
2222
}
2323

2424
#[unsafe(no_mangle)]
25-
pub extern fn transform() -> *mut u8 {
25+
pub extern "C" fn transform() -> *mut u8 {
2626
match try_transform() {
2727
Ok(o) => match o {
2828
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json),

tests/modules/rust_wasm32_normalize/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ pub struct Page {
3030
static PENDING_PAGES: RwLock<Lazy<VecDeque<Page>>> = RwLock::new(Lazy::new(|| VecDeque::new()));
3131

3232
#[unsafe(no_mangle)]
33-
pub extern fn alloc(size: usize) -> *mut u8 {
33+
pub extern "C" fn alloc(size: usize) -> *mut u8 {
3434
lens_sdk::alloc(size)
3535
}
3636

3737
#[unsafe(no_mangle)]
38-
pub extern fn transform() -> *mut u8 {
38+
pub extern "C" fn transform() -> *mut u8 {
3939
match try_transform() {
4040
Ok(o) => match o {
4141
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json.clone()),

tests/modules/rust_wasm32_rename/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,12 +42,12 @@ pub struct Parameters {
4242
static PARAMETERS: RwLock<StreamOption<Parameters>> = RwLock::new(None);
4343

4444
#[unsafe(no_mangle)]
45-
pub extern fn alloc(size: usize) -> *mut u8 {
45+
pub extern "C" fn alloc(size: usize) -> *mut u8 {
4646
lens_sdk::alloc(size)
4747
}
4848

4949
#[unsafe(no_mangle)]
50-
pub extern fn set_param(ptr: *mut u8) -> *mut u8 {
50+
pub extern "C" fn set_param(ptr: *mut u8) -> *mut u8 {
5151
match try_set_param(ptr) {
5252
Ok(_) => lens_sdk::nil_ptr(),
5353
Err(e) => lens_sdk::to_mem(lens_sdk::ERROR_TYPE_ID, &e.to_string().as_bytes())
@@ -64,7 +64,7 @@ fn try_set_param(ptr: *mut u8) -> Result<(), Box<dyn Error>> {
6464
}
6565

6666
#[unsafe(no_mangle)]
67-
pub extern fn transform() -> *mut u8 {
67+
pub extern "C" fn transform() -> *mut u8 {
6868
match try_transform() {
6969
Ok(o) => match o {
7070
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json),

tests/modules/rust_wasm32_simple/src/lib.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,12 +29,12 @@ pub struct Output {
2929
}
3030

3131
#[unsafe(no_mangle)]
32-
pub extern fn alloc(size: usize) -> *mut u8 {
32+
pub extern "C" fn alloc(size: usize) -> *mut u8 {
3333
lens_sdk::alloc(size)
3434
}
3535

3636
#[unsafe(no_mangle)]
37-
pub extern fn transform() -> *mut u8 {
37+
pub extern "C" fn transform() -> *mut u8 {
3838
match try_transform() {
3939
Ok(o) => match o {
4040
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json),

tests/modules/rust_wasm32_simple2/src/lib.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@ pub struct Value {
2121
}
2222

2323
#[unsafe(no_mangle)]
24-
pub extern fn alloc(size: usize) -> *mut u8 {
24+
pub extern "C" fn alloc(size: usize) -> *mut u8 {
2525
lens_sdk::alloc(size)
2626
}
2727

2828
#[unsafe(no_mangle)]
29-
pub extern fn transform() -> *mut u8 {
29+
pub extern "C" fn transform() -> *mut u8 {
3030
match try_transform() {
3131
Ok(o) => match o {
3232
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json),
@@ -57,7 +57,7 @@ fn try_transform() -> Result<StreamOption<Vec<u8>>, Box<dyn Error>> {
5757
}
5858

5959
#[unsafe(no_mangle)]
60-
pub extern fn inverse() -> *mut u8 {
60+
pub extern "C" fn inverse() -> *mut u8 {
6161
match try_inverse() {
6262
Ok(o) => match o {
6363
Some(result_json) => lens_sdk::to_mem(lens_sdk::JSON_TYPE_ID, &result_json),

0 commit comments

Comments
 (0)