cpp: add a workaround for service generation