According to iwyu, to avoid unecessary rebuilds and to reduce the
chances of breakages of the build if includes are rearranged, the
code that uses serial_open() and ser_close() should include
serial.h while the code that uses read_block() write_block() and
similar should include iofunc.h, code that uses all of them should
include both files.
Found with iwyu.
This is necessary to keep alignment between the client view of rig->state and the shared libarary view
Including PTHREAD functions in rig->state necessitated this as HAVE_PTHREAD only defined during hamlib compilation.
Clients including hamlib/rig.h did not pick up all the HAVE* config variable that control what gets included
https://github.com/Hamlib/Hamlib/issues/947
Change hamlib_port_t to a pointer in rig.state
Deprecate static hamlib_port_t structure
New hamlib_port_t structure at end of rig.state
Clients built with older hamlib will use old structure in DLL
Clients built with newer hamlib will use new structure in DLL
So we maintain backwards compatibility until Hamlib 5.0
https://github.com/Hamlib/Hamlib/issues/894