I’m playing around with implementing Termbox in Rust since the existing libraries only wrap the C library and so don’t provide support for the Windows Console. As I’m doing this, I’m thinking about what it would take to make the library support both Windows and Unix.
What are the “accepted” ways to write a library that supports both Windows and Unix through largely different OS APIs? Are there good, and relatively simple, examples of libraries that do this? It would be nice to be able to share some of the code, but I’m not really sure where or how to do all that.