diff options
author | Melody Horn <melody@boringcactus.com> | 2021-10-30 00:21:27 -0600 |
---|---|---|
committer | Melody Horn <melody@boringcactus.com> | 2021-10-30 00:21:27 -0600 |
commit | 2c422c2841f24be9a3fb65b1bf090bc847bae2b4 (patch) | |
tree | 77949cf90ad6cb7d8ad4f19a0b9b50fc7102861a /src | |
parent | 2d242f308a0c14aa46407b20afaadead9b22150a (diff) | |
download | shit-wx-sys-2c422c2841f24be9a3fb65b1bf090bc847bae2b4.tar.gz shit-wx-sys-2c422c2841f24be9a3fb65b1bf090bc847bae2b4.zip |
..what is even fucking happening
Diffstat (limited to 'src')
-rw-r--r-- | src/lib.rs | 29 | ||||
-rw-r--r-- | src/wx-sys.cpp | 6 | ||||
-rw-r--r-- | src/wx-sys.h | 4 |
3 files changed, 30 insertions, 9 deletions
@@ -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(); |