Open WLCIssuesBot opened 7 years ago
Comment by Cloudef
Monday Sep 05, 2016 at 19:13 GMT
There seems to be quite lots of indent / space changes, can you fix those before I check further.
Comment by johalun
Monday Sep 05, 2016 at 19:26 GMT
Ah you're right.. I thought it was tabs that had been converted to spaces automatically but I see that indent is changed. Will fix it!
Comment by johalun
Monday Sep 05, 2016 at 19:52 GMT
We end up with#ifdefs all over the place.. Maybe cleanest to put in separate files?
Comment by Cloudef
Monday Sep 05, 2016 at 20:36 GMT
You could separate the parts that are different into functions into own files, provide tty_backend struct that contains the function prototypes. Have something like wlc_tty_backend_init(&backend); at begin of wlc_tty_init, the implementation that gets called for wlc_tty_backend_init would depend on platform (linux or bsd), by telling cmake which .c file to compile. tty.h would contain the prototype for wlc_tty_backend_init, but implementation would be in the platform specific file.
If that makes sense. Above is also really easy to modify so that tty backends could be loaded from .so's (plugins), but I don't think we ever need that. (Or at least I hope there doesn't exist multiple tty apis on single platform)
johalun included the following code: https://github.com/Cloudef/wlc/pull/194/commits