1
0
mirror of https://github.com/UzixLS/picocom.git synced 2025-07-19 07:21:18 +03:00

Small refactoring in term.c for bsd improvements

Introduced `#define HAS_CUSTOM_BAUD` for platforms which have appropriate implementation.

Moving that `#if defined(__linux__) && defined(USE_CUSTOM_BAUD)` ... stuff out of `term.c`and put it to `termios2.h` / `custbaud_bsd.h` headers.
Moving that platform specific `#ifdefs` to the platform specific headers helps removing duplicate complex `#ifdef` constructs.
The both platform specific headers then do `#define HAS_CUSTOM_BAUD` to signal that custom baudrate support is implemented for the target platform.
I'd tested all above mentioned platforms with both USE_CUSTOM_BAUD unset and set to check if that refactoring don't raises unexpected issues.
This commit is contained in:
Joe Merten
2018-01-15 19:47:46 +01:00
parent ab140a283b
commit f9e0b4c8a2
6 changed files with 38 additions and 30 deletions

View File

@ -1601,7 +1601,7 @@ show_usage(char *name)
printf(" LINENOISE is enabled\n");
printf(" HISTFILE is: %s\n", HISTFILE);
#endif
#ifdef USE_CUSTOM_BAUD
#if defined(USE_CUSTOM_BAUD) && defined(HAS_CUSTOM_BAUD)
printf(" USE_CUSTOM_BAUD is enabled\n");
#endif