replace functions/typedef's from compat-1.2.h