Define _XOPEN_SOURCE_EXTENDED where necessary