make compatible with apps that have EXTEND_PROTOTYPES=false, remove dead code