baseview icon indicating copy to clipboard operation
baseview copied to clipboard

Add support for Windows 7 and 8

Open helgoboss opened this issue 2 years ago • 2 comments

This implements #145.

helgoboss avatar Apr 16 '23 07:04 helgoboss

Does this require adding a dependency on libloading? I would just use LoadLibrary and GetProcAddress since we already depend on the winapi crate anyways (which should probably be replaced with the windows crate at some point), and then store the function pointers in a OnceCell (which is now in the standard library) so they're always there without having to look them up again each time you call them.

I proposed doing this in the Discord a couple months back but no one seemed to be particularly enthusiastic about having to maintain WIndows 7 support since it may break over time if you don't periodically test on it, and Windows 7 and 8 are end of life.

EDIT: I thought OnceCell in the standard library was already stabilized, but it won't be until Rust 1.70/June 1st.

robbert-vdh avatar Apr 16 '23 12:04 robbert-vdh

It doesn't strictly need libloading, I just thought it's easier to rely on the abstraction. But yes, I guess I could change it to use LoadLibrary and GetProcAddress directly.

I'm also not really inclined to test this regularly. But eagerly linking to the library functions completely rules out the possiblity to run this on older Windows versions ... I find this a bit restrictive for a general-purpose lib, especially when it's only because of 2 functions and the solution is rather simple. Maybe it's okay if it's not regularly tested as long as the the README doesn't actively advertise that it supports old Windows versions?

Some audio folks are quite conservative when it comes to the OS. There was a user wondering why ReaLearn doesn't work on his syststem (https://github.com/helgoboss/realearn/issues/791). That's why I added it in the first place.

helgoboss avatar Apr 16 '23 16:04 helgoboss