Fix build for Visual Studio 2008/2010. Did not test 2012, if it builds without these changes VC compiler version needs to be added to the ifdefs.