Portable source/proof identity; the permitted corpus is checked separately.
(source_file: str | Path, root: Path)
| 4543 | _DECLDEF_IMPL_SUFFIXES = frozenset({".m", ".mm", ".cpp", ".cc", ".cxx", ".c"}) |
| 4544 | |
| 4545 | def _cpp_source_key(source_file: str | Path, root: Path) -> str: |
| 4546 | """Portable source/proof identity; the permitted corpus is checked separately.""" |
| 4547 | if not source_file: |
| 4548 | return "" |
| 4549 | try: |
| 4550 | path = _resolve_cached(root / source_file) |
| 4551 | try: |
| 4552 | return os.path.relpath(path, _resolve_cached(root)).replace("\\", "/") |
| 4553 | except ValueError: |
| 4554 | # No relative path to a root on another Windows drive; the absolute |
| 4555 | # path is still a distinct identity for the file. |
| 4556 | return path.as_posix() |
| 4557 | except (OSError, RuntimeError, ValueError): |
| 4558 | return "" |
| 4559 | |
| 4560 | |
| 4561 | def _cpp_reconciliation_paths( |
no outgoing calls
no test coverage detected