mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-19 17:32:37 +00:00
Strip ./ from source_file_line
This commit is contained in:
parent
0f9bb4c892
commit
b8876ac2af
@ -63,6 +63,10 @@ bool odr_guard_impl(const std::type_index &it_ti, const char *tc_id) {
|
||||
fflush(stdout);
|
||||
#endif
|
||||
std::string tc_id_str{tc_id};
|
||||
if (tc_id_str.size() > 2 && tc_id_str[0] == '.'
|
||||
&& (tc_id_str[1] == '/' || tc_id_str[1] == '\\')) {
|
||||
tc_id_str = tc_id_str.substr(2);
|
||||
}
|
||||
auto [reg_iter, added] = odr_guard_registry().insert({it_ti, tc_id_str});
|
||||
if (!added && reg_iter->second != tc_id_str) {
|
||||
std::system_error err(std::make_error_code(std::errc::state_not_recoverable),
|
||||
|
Loading…
Reference in New Issue
Block a user