fix trap prototypes to be more portable