Generate dispatch function for signals via macro