Extensions of the four-vertex theorem