If i understood correctly, the problem is with a itkImageFileReader include in these files. If this include is commented and there are no readers in these files, the compilation finishes without problems.
What can you recommend to check before digging any further?
Taking a quick look at the error log, it looks like the platform is being incorrectly detected. I doubt POSIX needs to be defined on *nix. The problem seems to come from KWSys. @brad.king might have more insight.