Skip to content

Commit a8ab9c7

Browse files
committed
Fixed Compilation on 32b Platforms
1 parent 6e6ed42 commit a8ab9c7

File tree

1 file changed

+5
-8
lines changed

1 file changed

+5
-8
lines changed

mozjs/src/jsval.rs

+5-8
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ fn AssertGCPointerValid(bits: u64) {
102102

103103
#[cfg(target_pointer_width = "32")]
104104
#[inline(always)]
105-
fn AssertIsGCPointerValid(bits: u64) {}
105+
fn AssertGCPointerValid(bits: u64) {}
106106

107107
#[cfg(target_pointer_width = "64")]
108108
#[inline(always)]
@@ -269,7 +269,6 @@ impl JSVal {
269269
}
270270

271271
#[inline(always)]
272-
#[cfg(target_pointer_width = "64")]
273272
pub fn is_bigint(&self) -> bool {
274273
self.toTag() == ValueTag::BIGINT as u64
275274
}
@@ -358,27 +357,26 @@ impl JSVal {
358357
}
359358

360359
#[inline(always)]
361-
#[cfg(target_pointer_width = "64")]
362360
pub fn to_string(&self) -> *mut JSString {
363361
assert!(self.is_string());
364362
let ptrBits = self.payload();
365-
AssertGCPointerAlignment(ptrBits);
363+
AssertGCPointerAlignment(ptrBits as u64);
366364
ptrBits as usize as *mut JSString
367365
}
368366

369367
#[inline(always)]
370368
pub fn to_symbol(&self) -> *mut Symbol {
371369
assert!(self.is_symbol());
372370
let ptrBits = self.payload();
373-
AssertGCPointerAlignment(ptrBits);
371+
AssertGCPointerAlignment(ptrBits as u64);
374372
ptrBits as usize as *mut Symbol
375373
}
376374

377375
#[inline(always)]
378376
pub fn to_bigint(&self) -> *mut BigInt {
379377
assert!(self.is_bigint());
380378
let ptrBits = self.payload();
381-
AssertGCPointerAlignment(ptrBits);
379+
AssertGCPointerAlignment(ptrBits as u64);
382380
ptrBits as usize as *mut BigInt
383381
}
384382

@@ -409,12 +407,11 @@ impl JSVal {
409407
pub fn to_gcthing(&self) -> *mut c_void {
410408
assert!(self.is_gcthing());
411409
let ptrBits = self.payload();
412-
AssertGCPointerAlignment(ptrBits);
410+
AssertGCPointerAlignment(ptrBits as u64);
413411
ptrBits as *mut c_void
414412
}
415413

416414
#[inline(always)]
417-
#[cfg(target_pointer_width = "64")]
418415
pub fn to_boolean(&self) -> bool {
419416
assert!(self.is_boolean());
420417
self.payload() != 0

0 commit comments

Comments
 (0)