This is a copy of list.h from xserver commit 74469895e39fa38337f59edd64c4031ab9bb51d8, modified to prevent namespace clashes with list.h.