Skip to content
This repository has been archived by the owner on Jul 14, 2022. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
lynnux committed Mar 15, 2020
1 parent 30290bb commit be3c59f
Showing 1 changed file with 20 additions and 14 deletions.
34 changes: 20 additions & 14 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
## Final solution
No need this crate any more! Download [YY-Thunks-Binary](https://github.com/Chuyu-Team/YY-Thunks/releases), extract it somewhere, for xp we use the x86 binary, take `E:\YY-Thunks-1.0.2.4-Beta-Binary\objs\x86\YY_Thunks_for_WinXP.obj` for example, create a bat file with content\:
```
@echo off
cd %cd%
set RUSTFLAGS=-Ctarget-feature=+crt-static -Clink-args=/subsystem:console,5.01 -Clink-args=E:\YY-Thunks-1.0.2.4-Beta-Binary\objs\x86\YY_Thunks_for_WinXP.obj
doskey cargo1=cargo $* --target i686-pc-windows-msvc
cargo build --target i686-pc-windows-msvc --release
cmd /k
```
just run the bat file. Cause it use the obj file to link, it's may incompatible with mingw.


## Usage

add this to your Cargo.toml:
Expand All @@ -30,7 +17,14 @@ fn main()
//...
}
```
for MSVC toolchain, build with command: `cargo rustc -- -C link-args="/subsystem:console,5.01"` or `cargo rustc --release -- -C link-args="/subsystem:console,5.01"`.
for MSVC toolchain, you can run the bat file\:
```
@echo off
cd %cd%
set RUSTFLAGS=-Ctarget-feature=+crt-static -Clink-args=/subsystem:console,5.01
cargo build --target i686-pc-windows-msvc --release
cmd /k
```

## How does it work?

Expand All @@ -45,6 +39,18 @@ Idea of version `0.2` inspired by [ctor](https://github.com/mmastrac/rust-ctor).
* WakeAllConditionVariable
* WakeConditionVariable

## External API solution
Some third party crate use winapi that not support xp, you can try [YY-Thunks](https://github.com/Chuyu-Team/YY-Thunks) to resolve this.
Download [YY-Thunks-Binary](https://github.com/Chuyu-Team/YY-Thunks/releases), extract it somewhere, for xp we use the x86 binary, take `E:\YY-Thunks-1.0.2.4-Beta-Binary\objs\x86\YY_Thunks_for_WinXP.obj` for example, run the bat file\:
```
@echo off
cd %cd%
set RUSTFLAGS=-Ctarget-feature=+crt-static -Clink-args=/subsystem:console,5.01 -Clink-args=E:\YY-Thunks-1.0.2.4-Beta-Binary\objs\x86\YY_Thunks_for_WinXP.obj
cargo build --target i686-pc-windows-msvc --release
cmd /k
```
just run the bat file. Cause it use the obj file to link, it's may incompatible with mingw.

## Testing Result
[Testing code](https://github.com/lynnux/xpsupport-sys/tree/master/test) are from libstd/sync, only `mpsc::stress_recv_timeout_shared` seems deadlock, all other are passed through!
You may consider [parking_lot](https://github.com/Amanieu/parking_lot) crate as the sync library or [spin](https://github.com/mvdnes/spin-rs), they both support XP.
Expand Down

0 comments on commit be3c59f

Please sign in to comment.