rust3ds / pthread-3ds

PThread implementation for Nintendo 3DS Horizon OS targets. Keep in mind that Horizon OS uses a cooperative, and not preemptive, threading model.
Apache License 2.0
12 stars 7 forks source link

Fix link errors by using inlining #15

Closed AzureMarker closed 2 years ago

AzureMarker commented 2 years ago

Fixes https://github.com/Meziu/ctru-rs/issues/51

The release build (ex. for ctru-rs examples) was doing some extra optimizations and throwing away the submodules of this crate after the refactor split it into multiple files.

For some reason if the init call is behind another function call, it is as if it doesn't exist. Luckily forcing inlining makes sure the module doesn't get thrown away.

The thread::attr init call also needs to appear in the top level init, otherwise you still get link errors.