workerFunc
is a function in the unnamed namespace. The MSVC compiler (Version 19.16.27026.1 for x64) was used to generate two object files from the same translation unit, one per machine.
Here are symbol names that compiler has produced for the same source code:
Machine 1:
?workerFunc@?A0x65bd3c1e@@YAXPEAVMyClass@ns1@ns2@@NNNAEAN111AEA_N@Z
Machine 2:
?workerFunc@?A0x50c2f7a6@@YAXPEAVMyClass@ns1@ns2@@NNNAEAN111AEA_N@Z
How to force the compiler to generate same symbol name for different machines for a function in an unnamed namespace?