Implemented detection of calling convention (refs #186, #187, #194).