Move local stand-alone utility function in anonymous namespace
this should avoid linking problems with other implementations of functions with the same name
Edited by Marco Cattaneo
this should avoid linking problems with other implementations of functions with the same name