format the headers of this library that should include as a single String.
(deopt: &Deopt)
| 663 | |
| 664 | /// format the headers of this library that should include as a single String. |
| 665 | pub fn format_library_header_strings(deopt: &Deopt) -> &'static str { |
| 666 | static HEADER: OnceCell<String> = OnceCell::new(); |
| 667 | HEADER.get_or_init(|| { |
| 668 | let mut content = String::new(); |
| 669 | for header in get_standard_headers() { |
| 670 | content.push_str(&format!("#include <{header}>\n")); |
| 671 | } |
| 672 | for header in get_library_headers(deopt).unwrap() { |
| 673 | if header.ends_with(".h") { |
| 674 | content.push_str("extern \"C\" {\n"); |
| 675 | content.push_str(&format!("#include <{header}>\n")); |
| 676 | content.push_str("}\n"); |
| 677 | } else { |
| 678 | content.push_str(&format!("#include <{header}>\n")); |
| 679 | } |
| 680 | } |
| 681 | content |
| 682 | }) |
| 683 | } |
| 684 | |
| 685 | pub fn get_library_headers(deopt: &Deopt) -> Result<Vec<String>> { |
| 686 | get_include_lib_headers(deopt) |
no test coverage detected