[serial] Added preprocessor guards for externing if in the C++ environment
[serial] Added preprocessor guards for externing if in the C++ environment

Signed-off-by: Brendan Kerrigan <b0223838083cf277251c53ef8ca04ebe97abb6c2@ainfosec.com>

connojd/hypervisor,RicoAntonioFelix/hypervisor,RicoAntonioFelix/hypervisor,Bareflank/hypervisor,Bareflank/hypervisor,rianquinn/hypervisor,connojd/hypervisor,rianquinn/hypervisor,RicoAntonioFelix/hypervisor,Bareflank/hypervisor,connojd/hypervisor,rianquinn/hypervisor