Skip to content

Commit

Permalink
fix for old and new tools
Browse files Browse the repository at this point in the history
  • Loading branch information
Arlie Davis committed Jun 6, 2024
1 parent 0506439 commit c4b1750
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion crates/libs/core/src/imp/weak_ref_count.rs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ impl WeakRefCount {
let tear_off = TearOff::new(object, count_or_pointer as u32);
let tear_off_ptr: *mut c_void = transmute_copy(&tear_off);
let encoding: usize =
((tear_off_ptr as usize) >> 1) | (1 << (core::mem::size_of::<usize>() * 8 - 1));
((tear_off_ptr as usize) >> 1) | (1 << (usize::BITS - 1));

loop {
match self.0.compare_exchange_weak(
Expand Down
1 change: 1 addition & 0 deletions crates/libs/metadata/src/blob.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::*;
use core::mem::align_of;

pub struct Blob {
pub file: &'static File,
Expand Down
1 change: 1 addition & 0 deletions crates/libs/metadata/src/file.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
use super::*;
use core::mem::{align_of, size_of};

pub struct File {
pub reader: *const Reader,
Expand Down
2 changes: 2 additions & 0 deletions crates/libs/version/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ Learn more about Rust for Windows here: <https://github.com/microsoft/windows-rs

#![cfg_attr(not(test), no_std)]

use core::mem::size_of;

mod bindings;
use bindings::*;

Expand Down

0 comments on commit c4b1750

Please sign in to comment.