minor code cleanups

Replace __va_list with va_list and add guard around pagesize definition.