__attribute__(visibility) only works for gcc newer than 4.1.2

Fix issue reported by Jonathan Egstad.