mirror of
https://github.com/pybind/pybind11.git
synced 2025-01-20 01:42: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);
|
fflush(stdout);
|
||||||
#endif
|
#endif
|
||||||
std::string tc_id_str{tc_id};
|
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});
|
auto [reg_iter, added] = odr_guard_registry().insert({it_ti, tc_id_str});
|
||||||
if (!added && reg_iter->second != tc_id_str) {
|
if (!added && reg_iter->second != tc_id_str) {
|
||||||
std::system_error err(std::make_error_code(std::errc::state_not_recoverable),
|
std::system_error err(std::make_error_code(std::errc::state_not_recoverable),
|
||||||
|
Loading…
Reference in New Issue
Block a user