Spin structures and gauge theory