mirror of
https://gitee.com/openharmony/third_party_rust_cxx
synced 2024-11-23 07:10:29 +00:00
Accept non-\n line endings
On Windows, include_str brings in cxxbridge.h with \r\n line endings.
This commit is contained in:
parent
bce77ba9fe
commit
2a1eaac049
@ -1,8 +1,8 @@
|
||||
pub static HEADER: &str = include_str!("include/cxxbridge.h");
|
||||
|
||||
pub fn get(guard: &str) -> &'static str {
|
||||
let ifndef = format!("#ifndef {}\n", guard);
|
||||
let endif = format!("#endif // {}\n", guard);
|
||||
let ifndef = format!("#ifndef {}", guard);
|
||||
let endif = format!("#endif // {}", guard);
|
||||
let begin = HEADER.find(&ifndef);
|
||||
let end = HEADER.find(&endif);
|
||||
if let (Some(begin), Some(end)) = (begin, end) {
|
||||
|
Loading…
Reference in New Issue
Block a user