tools/corrosion/test/hostbuild/hostbuild/src/main.rs
author unC0Rr
Wed, 28 Aug 2024 15:31:51 +0200
branchtransitional_engine
changeset 16021 6a3dc15b78b9
permissions -rw-r--r--
Add corrosion as a subdirectory, CMake fixes
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
16021
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     1
use std::os::raw::c_char;
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     2
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     3
extern "C" {
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     4
    fn c_function(name: *const c_char);
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     5
}
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     6
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     7
fn main() {
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     8
    println!("ok");
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
     9
    let name = b"Rust Hostbuild\0";
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    10
    unsafe {
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    11
        c_function(name.as_ptr() as _);
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    12
    }
6a3dc15b78b9 Add corrosion as a subdirectory, CMake fixes
unC0Rr
parents:
diff changeset
    13
}