The __SYNTHESIS__ macro is automatically defined by Vivado HLS when synthesis is performed.
This macro is defined during the High-Level Synthesis and ports will be generated accordingly.
However, the macro is not defined during C simulation and as a result, you might not be able to properly test your designs.
The simulation and co-simulation may mismatch as the generated software and hardware may mismatch in terms of ports, numbers and names.
It can lead to a crash in the co-simulation with or without messages.