diff options
| author | Linus Färnstrand <linus@mullvad.net> | 2023-08-08 13:23:49 +0200 |
|---|---|---|
| committer | Linus Färnstrand <linus@mullvad.net> | 2023-08-08 15:02:32 +0200 |
| commit | 0f96f48db6e0cc914ca7ab56337bd510c11e932f (patch) | |
| tree | babb09cebf912f6d260bf66682c21144c1f7c2d4 | |
| parent | dfe29f3f554a9beb3dbe071284b16b762f6468dc (diff) | |
| download | mullvadvpn-0f96f48db6e0cc914ca7ab56337bd510c11e932f.tar.xz mullvadvpn-0f96f48db6e0cc914ca7ab56337bd510c11e932f.zip | |
impl of Encode for NSOperatingSystemVersion
| -rw-r--r-- | mullvad-daemon/src/macos_launch_daemon.rs | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mullvad-daemon/src/macos_launch_daemon.rs b/mullvad-daemon/src/macos_launch_daemon.rs index d71e4b49bb..3e10d94ce7 100644 --- a/mullvad-daemon/src/macos_launch_daemon.rs +++ b/mullvad-daemon/src/macos_launch_daemon.rs @@ -18,9 +18,18 @@ extern "C" {} #[repr(C)] #[derive(Debug)] struct NSOperatingSystemVersion { - major_version: libc::c_ulong, - minor_version: libc::c_ulong, - patch_version: libc::c_ulong, + major_version: libc::c_longlong, + minor_version: libc::c_longlong, + patch_version: libc::c_longlong, +} + +/// Implement Objective-C type encoding for the struct. Allows the `objc` crate +/// to perform function signature matching before performing calls into the Objective-C +/// runtime. This is needed to be able to enable the `verify_message` feature on `objc`. +unsafe impl objc::Encode for NSOperatingSystemVersion { + fn encode() -> objc::Encoding { + unsafe { objc::Encoding::from_str("{?=qqq}") } + } } /// Authorization status of the Mullvad daemon. |
