Skip to content

Commit

Permalink
Try to make LLVM5 happy
Browse files Browse the repository at this point in the history
4d76385 (Detect kernel headers even if they are splitted into source/
and build/ directories) used C++17 structured binding for return
arguments, but apparently it fails with LLVM5:

	#399 (comment)

Try to fix it by not using structured binding and by extracting returned
tuple elements manually.
  • Loading branch information
navytux committed Feb 15, 2019
1 parent d3c6503 commit 644943a
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/clang_parser.cpp
Expand Up @@ -220,7 +220,12 @@ void ClangParser::parse(ast::Program *program, StructMap &structs)
std::vector<std::string> kflags;
struct utsname utsname;
uname(&utsname);
auto [ksrc, kobj] = get_kernel_dirs(utsname);
// auto [ksrc, kobj] = get_kernel_dirs(utsname); XXX fails with LLVM5
std::string ksrc, kobj;
auto kdirs = get_kernel_dirs(utsname);
ksrc = std::get<0>(kdirs);
kobj = std::get<1>(kdirs);

if (ksrc != "")
kflags = get_kernel_cflags(utsname.machine, ksrc, kobj);

Expand Down

0 comments on commit 644943a

Please sign in to comment.