Cloudef / wlc

High-level Wayland compositor library
MIT License
331 stars 58 forks source link

Improvements to FreeBSD tty code. #194

Closed johalun closed 7 years ago

Cloudef commented 8 years ago

There seems to be quite lots of indent / space changes, can you fix those before I check further.

johalun commented 8 years ago

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!

johalun commented 8 years ago

We end up with#ifdefs all over the place.. Maybe cleanest to put in separate files?

Cloudef commented 8 years ago

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)

ddevault commented 7 years ago

Presumably this is obsolete.