summaryrefslogtreecommitdiff
path: root/test_ffi/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'test_ffi/src/lib.rs')
-rw-r--r--test_ffi/src/lib.rs7
1 files changed, 7 insertions, 0 deletions
diff --git a/test_ffi/src/lib.rs b/test_ffi/src/lib.rs
index bc89bd66c..b061ca8d5 100644
--- a/test_ffi/src/lib.rs
+++ b/test_ffi/src/lib.rs
@@ -404,3 +404,10 @@ pub struct Structure {
#[no_mangle]
pub static mut static_ptr: Structure = Structure { _data: 42 };
+
+static STRING: &str = "Hello, world!\0";
+
+#[no_mangle]
+extern "C" fn ffi_string() -> *const u8 {
+ STRING.as_ptr()
+}