nhassert_failed is called when an nhassert's condition is false */
| 687 | |
| 688 | /* nhassert_failed is called when an nhassert's condition is false */ |
| 689 | void |
| 690 | nhassert_failed(const char *expression, const char *filepath, int line) |
| 691 | { |
| 692 | const char *filename, *p; |
| 693 | |
| 694 | /* Attempt to get filename from path. |
| 695 | TODO: we really need a port provided function to return a filename |
| 696 | from a path. */ |
| 697 | filename = filepath; |
| 698 | if ((p = strrchr(filename, '/')) != 0) |
| 699 | filename = p + 1; |
| 700 | if ((p = strrchr(filename, '\\')) != 0) |
| 701 | filename = p + 1; |
| 702 | #ifdef VMS |
| 703 | /* usually "device:[directory]name" |
| 704 | but might be "device:[root.][directory]name" |
| 705 | and either "[directory]" or "[root.]" or both can be delimited |
| 706 | by <> rather than by []; find the last of ']', '>', and ':' */ |
| 707 | if ((p = strrchr(filename, ']')) != 0) |
| 708 | filename = p + 1; |
| 709 | if ((p = strrchr(filename, '>')) != 0) |
| 710 | filename = p + 1; |
| 711 | if ((p = strrchr(filename, ':')) != 0) |
| 712 | filename = p + 1; |
| 713 | #endif |
| 714 | |
| 715 | impossible("nhassert(%s) failed in file '%s' at line %d", |
| 716 | expression, filename, line); |
| 717 | } |
| 718 | |
| 719 | /*pline.c*/ |
nothing calls this directly
no test coverage detected