Commit 9deed39f authored by Jeremy Soller's avatar Jeremy Soller

Merge branch 'relibc-cpp-extern' into 'master'

Change how externs are emitted for relibc

See merge request !4
parents 95821b3b b7b2ea75
......@@ -133,11 +133,13 @@ impl Bindings {
out.new_line();
}
if self.config.language == Language::Cxx {
out.new_line_if_not_start();
out.write("extern \"C\" {");
out.new_line();
}
out.new_line_if_not_start();
out.write("#ifdef __cplusplus");
out.new_line();
out.write("extern \"C\" {");
out.new_line();
out.write("#endif");
out.new_line();
for global in &self.globals {
out.new_line_if_not_start();
......@@ -157,11 +159,15 @@ impl Bindings {
out.new_line();
}
if self.config.language == Language::Cxx {
out.new_line_if_not_start();
out.write("} // extern \"C\"");
out.new_line();
out.new_line_if_not_start();
out.write("#ifdef __cplusplus");
out.new_line();
out.write("} // extern \"C\"");
out.new_line();
out.write("#endif");
out.new_line();
if self.config.language == Language::Cxx {
self.close_namespaces(&mut out);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment