Conversation
|
Hmmmm.... maybe we can entire remove libc as dependency. And use |
|
I thought about that, but |
|
I think we can define our timeval like this Where did you find suseconds_t? |
|
https://github.com/a1ien/rusb/blob/59d9ac6fcfa68c91a4d1e41a0b568293a6d759bb/src/context.rs#L16 (although, that could be written to use That's also not portable—Linux and Windows follow that, but macOS defines |
|
I like idea about use |
|
Is there anything wrong with depending on libc? Most likely, something else is going to depend on it anyways. |
No. Just to reduce dependency. And if we could not depend on |
This PR exports libc, so that libc can be removed as a dependency for rusb. This is intended to allow for easily replacing this crate while still using rusb on a platform that doesn't have a libc—e.g. WASM. I've written a crate that is ABI- and API-compatible with this crate and libusb that uses WebUSB, but would still like to be able to use rusb and other crates that depend on it. Cargo's
patchfeature makes that easy, but then it's still necessary to define a separate libc crate to define the few types that it uses.If this gets merged, I'll send another PR to rusb to not depend on libc any more and only use this crate.