New HPPEMIT statements have been added to the following Indy components to address “Unresolved external SetPort(A/W)” linker errors in C++Builder:
TIdDNSResolver TIdIOHandler TIdIPMCastBase TIdTCPClientCustom TIdUDPBase TIdUDPClient
The linker errors are due to name mangling mismatches between the compiler and linker, which are caused by the “#define SetPort …” macro in the Win32 API winspool.h header file.
“#pragma alias” is Embarcadero’s solution to solving name mangling mismatches – particularly useful when library code crosses the C++/Delphi boundary. Win32 API Ansi/Unicode function remapping macros are one cause of such mismatches (such as in this case). STRICT handling is another cause.