You can write a simple wrapper:
// header file
namespace Math {
int Add(int, int);
}
// implementation file
#include "c-library-header.h"
int Math::Add(int x, int y) {
return Sum(x, y);
}
I've split this into two files in order to avoid including the C header file in exposed code, i.e. to get a cleaner separation of either side of the interface. If you don't care about that, you could as well use just one file of inline
wrapper functions.
Concerning the approach you asked about, I'd really consider that an XY problem (search for that term online!). Trying to rename the imported functions is very hackish, at least it is unusual and surprising to the casual reader. Using a set of wrapper function is a common approach though.
Also, for functions that are not as trivial as the example, you sometimes have dynamically allocated returnvalues or error codes that are returned. In both of these cases, the wrapper code would not just provide the same function under a different name. For dynamically allocated returns, it would use either containers or smart pointers, for error codes it would use exceptions. In any case, those are things you can't represent by hacking the linker to rename symbols.