following ppport.h instructions for better portability