Skip to content

Commit 183f7c8

Browse files
committed
Allow reserve_stack and stack overflow exception registration to fail on unsupported systems
1 parent bec9678 commit 183f7c8

File tree

1 file changed

+14
-0
lines changed
  • library/std/src/sys/pal/windows

1 file changed

+14
-0
lines changed

library/std/src/sys/pal/windows/c.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -332,3 +332,17 @@ compat_fn_with_fallback! {
332332
rtabort!("unimplemented")
333333
}
334334
}
335+
336+
#[cfg(target_vendor = "rust9x")]
337+
compat_fn_with_fallback! {
338+
pub static KERNEL32: &CStr = c"kernel32" => { load: false, unicows: false };
339+
// >= XP
340+
// https://learn.microsoft.com/en-us/windows/win32/api/errhandlingapi/nf-errhandlingapi-addvectoredexceptionhandler
341+
pub fn AddVectoredExceptionHandler(
342+
first: u32,
343+
handler: PVECTORED_EXCEPTION_HANDLER
344+
) -> *mut core::ffi::c_void { core::ptr::null_mut() }
345+
// >= Vista / Server 2003 SP1 / XPx64
346+
// https://learn.microsoft.com/en-us/windows/win32/api/processthreadsapi/nf-processthreadsapi-setthreadstackguarantee
347+
pub fn SetThreadStackGuarantee(stacksizeinbytes: *mut u32) -> BOOL { TRUE }
348+
}

0 commit comments

Comments
 (0)