fix win32 build.rs

This commit is contained in:
Andrea Fioraldi 2021-03-18 16:06:46 +01:00
parent 59604a03ae
commit b769ae433b
2 changed files with 6 additions and 6 deletions

View File

@ -1,7 +1,7 @@
fn main() {
#[cfg(target_os = "windows")]
windows::build!(
windows::win32::system_services::{HANDLE, PSTR},
windows::win32::system_services::{HANDLE},
windows::win32::windows_programming::CloseHandle,
// API needed for the shared memory
windows::win32::system_services::{CreateFileMappingA, OpenFileMappingA, MapViewOfFile, UnmapViewOfFile},

View File

@ -446,10 +446,10 @@ pub mod shmem {
use super::ShMem;
use crate::{
bolts::bindings::{
windows::win32::system_services::HANDLE,
windows::win32::system_services::{
CreateFileMappingA, MapViewOfFile, OpenFileMappingA, UnmapViewOfFile,
},
windows::win32::system_services::{HANDLE},
windows::win32::windows_programming::CloseHandle,
},
Error,
@ -516,8 +516,8 @@ pub mod shmem {
String::from_utf8_lossy(map_str_bytes)
)));
}
let map =
MapViewOfFile(handle.clone(), FILE_MAP_ALL_ACCESS, 0, 0, map_size as u32) as *mut u8;
let map = MapViewOfFile(handle.clone(), FILE_MAP_ALL_ACCESS, 0, 0, map_size as u32)
as *mut u8;
if map == ptr::null_mut() {
return Err(Error::Unknown(format!(
"Cannot map shared memory {}",
@ -552,8 +552,8 @@ pub mod shmem {
String::from_utf8_lossy(map_str_bytes)
)));
}
let map =
MapViewOfFile(handle.clone(), FILE_MAP_ALL_ACCESS, 0, 0, map_size as u32) as *mut u8;
let map = MapViewOfFile(handle.clone(), FILE_MAP_ALL_ACCESS, 0, 0, map_size as u32)
as *mut u8;
if map == ptr::null_mut() {
return Err(Error::Unknown(format!(
"Cannot map shared memory {}",