[cpp] export global functions as special case