exiv2/contrib/cmake/msvc/cltest.cpp
clanmills 3c42fdddeb Fix include <exiv2/exiv2.hpp> to include exiv2/config.h (and consequential changes)
Fix cltest.cpp and version.cpp to report MSVC 2017 in which _MSC_VER == 1910
2018-09-01 20:19:45 +02:00

13 lines
434 B
C++

#include <stdio.h>
int main(int,const char**)
{
const char* vs[] = { "unknown" , "2005", "2008", "2010", "2012", "2013", "2015","2017" };
int v = (_MSC_VER-1300)/100;
if ( v < 0 || v >= (sizeof(vs)/sizeof(vs[0])) ) v = 0;
if ( v == 6 && _MSC_VER >= 1910 ) v++ ; // 2017 _MSC_VAR == 1910!
fprintf(stderr,"_%s = %d (%s) sizeof(void*) = %d\n","MSC_VER",_MSC_VER,vs[v],(int)sizeof(void*));
return 0;
}