1 #include <sstream>
2 
ver_string(std::string a,int b,int c,int d)3 std::string ver_string(std::string a, int b, int c, int d) {
4   std::ostringstream ss;
5   ss << a << '-' << b << '.' << c << '.' << d;
6   return ss.str();
7 }
ver_string(std::string a,int b)8 std::string ver_string(std::string a, int b) {
9   std::ostringstream ss;
10   ss << a << '-' << b;
11   return ss.str();
12 }
13 
14 
15 std::string CXX_VER =
16 #if defined(__clang__)
17 	ver_string("clang", __clang_major__, __clang_minor__, __clang_patchlevel__);
18 
19 #elif defined(__ICC) || defined(__INTEL_COMPILER)
20 	ver_string("icc", __INTEL_COMPILER);
21 
22 #elif defined(__GNUC__) || defined(__GNUG__)
23 	ver_string("g++", __GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__);
24 
25 #elif defined(__HP_cc) || defined(__HP_aCC)
26 	ver_string("hp", __HP_cc);
27 
28 #elif defined(__IBMC__) || defined(__IBMCPP__)
29 	ver_string("xl", __IBMCPP__);
30 
31 #elif defined(_MSC_VER)
32 	ver_string("mvs", _MSC_FULL_VER);
33 
34 #elif defined(__PGI)
35 	ver_string("pgi", __PGIC__, __PGIC_MINOR, __PGIC_PATCHLEVEL__);
36 
37 #elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
38 	ver_string("sun", __SUNPRO_CC);
39 
40 #endif
41