aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib.rs29
-rw-r--r--src/wx-sys.cpp6
-rw-r--r--src/wx-sys.h4
3 files changed, 30 insertions, 9 deletions
diff --git a/src/lib.rs b/src/lib.rs
index dca544b..44af2fe 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,9 +1,20 @@
-#![allow(
- non_camel_case_types,
- non_snake_case,
- unaligned_references,
- non_upper_case_globals,
- deref_nullptr
-)]
-
-include!(concat!(env!("OUT_DIR"), "/bindings.rs"));
+#[cxx::bridge]
+mod ffi {
+ unsafe extern "C++" {
+ include!("shit-wx-sys/src/wx-sys.h");
+
+ fn message_box();
+ }
+}
+
+pub use ffi::*;
+
+#[cfg(test)]
+mod test {
+ use super::*;
+
+ #[test]
+ fn test_message_box() {
+ message_box();
+ }
+}
diff --git a/src/wx-sys.cpp b/src/wx-sys.cpp
new file mode 100644
index 0000000..8e07962
--- /dev/null
+++ b/src/wx-sys.cpp
@@ -0,0 +1,6 @@
+#include "shit-wx-sys/src/wx-sys.h"
+#include <wx/msgdlg.h>
+
+void message_box() {
+ wxMessageBox("Hello World!!!");
+}
diff --git a/src/wx-sys.h b/src/wx-sys.h
new file mode 100644
index 0000000..68c4484
--- /dev/null
+++ b/src/wx-sys.h
@@ -0,0 +1,4 @@
+#include "rust/cxx.h"
+#include <memory>
+
+void message_box();