27 out <<
"#if defined(__clang_major__)\n"
28 "clang __clang_major__ __clang_minor__ __clang_patchlevel__\n"
29 "#elif defined(__BCC__)\n"
32 "gcc __GNUC__ __GNUC_MINOR__ __GNUC_PATCHLEVEL__\n"
34 "default_c_standard __STDC_VERSION__\n";
54 while(!in.fail() && std::getline(in, line))
56 if(line.empty() || line[0] ==
'#')
65 else if(
split[0] ==
"bcc")
67 else if(
split[0] ==
"clang")
74 else if(
split.size() == 2 &&
split[0] ==
"default_c_standard")
76 if(
split[1] ==
"199901L")
78 else if(
split[1] ==
"201112L")
80 else if(
split[1] ==
"201710L")
82 else if(
split[1] ==
"202000L" ||
split[1] ==
"202311L")
97 std::ofstream out(
cpp_in());
98 out <<
"default_cxx_standard __cplusplus\n";
103 {
executable,
"-E",
"-x",
"c++",
"-",
"-o",
"-"},
112 while(!
in2.fail() && std::getline(
in2, line))
114 if(line.empty() || line[0] ==
'#')
119 if(
split.size() == 2 &&
split[0] ==
"default_cxx_standard")
121 if(
split[1] ==
"199711L")
123 else if(
split[1] ==
"201103L")
125 else if(
split[1] ==
"201402L")
127 else if(
split[1] ==
"201703L")
ait supplies three of the four components needed: an abstract interpreter (in this case handling func...
struct configt::ansi_ct ansi_c
bool is_at_least(unsigned v_major, unsigned v_minor=0, unsigned v_patchlevel=0) const
void get(const std::string &executable)
configt::cppt::cpp_standardt default_cxx_standard
configt::ansi_ct::c_standardt default_c_standard
enum gcc_versiont::flavort flavor
std::ostream & operator<<(std::ostream &out, const gcc_versiont &v)
void configure_gcc(const gcc_versiont &gcc_version)
int run(const std::string &what, const std::vector< std::string > &argv)
unsigned unsafe_string2unsigned(const std::string &str, int base)
void split_string(const std::string &s, char delim, std::vector< std::string > &result, bool strip, bool remove_empty)