Brian Silverman | 4e662aa | 2022-05-11 23:10:19 -0700 | [diff] [blame^] | 1 | // Copyright 2020 Google LLC |
| 2 | // |
| 3 | // Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 4 | // https://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 5 | // <LICENSE-MIT or https://opensource.org/licenses/MIT>, at your |
| 6 | // option. This file may not be copied, modified, or distributed |
| 7 | // except according to those terms. |
| 8 | |
| 9 | use std::panic::UnwindSafe; |
| 10 | |
| 11 | use crate::RebuildDependencyRecorder; |
| 12 | use autocxx_bindgen::callbacks::ParseCallbacks; |
| 13 | |
| 14 | #[derive(Debug)] |
| 15 | pub(crate) struct AutocxxParseCallbacks(pub(crate) Box<dyn RebuildDependencyRecorder>); |
| 16 | |
| 17 | impl UnwindSafe for AutocxxParseCallbacks {} |
| 18 | |
| 19 | impl ParseCallbacks for AutocxxParseCallbacks { |
| 20 | fn include_file(&self, filename: &str) { |
| 21 | self.0.record_header_file_dependency(filename); |
| 22 | } |
| 23 | } |