added macros from svn; changed Ports class