Update sort.h

Added re-definition checks using the preprocessor