MCPcopy Create free account
hub / github.com/NetHack/NetHack / nt_assert_failed

Function nt_assert_failed

sys/windows/windsys.c:783–803  ·  view source on GitHub ↗

nt_assert_failed is called when an nhassert's condition is false */

Source from the content-addressed store, hash-verified

781
782/* nt_assert_failed is called when an nhassert's condition is false */
783void
784nt_assert_failed(const char *expression, const char *filepath, int line)
785{
786 const char * filename;
787
788 filename = strrchr(filepath, '\\');
789 filename = (filename == NULL ? filepath : filename + 1);
790
791 if (IsDebuggerPresent()) {
792 char message[BUFSIZ];
793 snprintf(message, sizeof(message),
794 "nhassert(%s) failed in file '%s' at line %d",
795 expression, filename, line);
796 OutputDebugStringA(message);
797 DebugBreak();
798 }
799
800 /* get file name from path */
801 impossible("nhassert(%s) failed in file '%s' at line %d",
802 expression, filename, line);
803}
804#endif /* SFCTOOL */
805
806/* used by util/sfctool.c as well as files.c */

Callers

nothing calls this directly

Calls 2

strrchrFunction · 0.85
impossibleFunction · 0.50

Tested by

no test coverage detected