25 std::ofstream out(tmp_file_in());
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";
41 {executable,
"-E",
"-",
"-o",
"-"},
51 std::ifstream in(tmp_file_out());
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")
93 std::ofstream out(cpp_in());
94 out <<
"default_cxx_standard __cplusplus\n";
99 {executable,
"-E",
"-x",
"c++",
"-",
"-o",
"-"},
106 std::ifstream in2(cpp_out());
108 while(!in2.fail() && std::getline(in2, line))
110 if(line.empty() || line[0] ==
'#')
115 if(split.size() == 2 && split[0] ==
"default_cxx_standard")
117 if(split[1] ==
"199711L")
119 else if(split[1] ==
"201103L")
121 else if(split[1] ==
"201402L")
123 else if(split[1] ==
"201703L")
135 unsigned _patchlevel)
const
157 const auto gcc_float128_minor_version =
164 gcc_version.
is_at_least(4u, gcc_float128_minor_version);
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)
bool ts_18661_3_Floatn_types
bool __float128_is_keyword