On windows, I can use GetModuleFileName() to get the current program(main module) name and the current module(library) name.
On linux, I can open /proc/self/maps and find these names.
on Mac(BSD), there's another method...
can I get the current module name?
can I get the root module name? (In the case of dynamic linking, this would be the first module, the 'program'? )
As a workaround I can define a symbol; the issue with that is when the code that uses that symbol is compiled that has to be different, and it's more of a core static library, so it shouldn't have to be recompiled; and will be wrong if mislinked.