Source:NetHack 3.4.3/util/panic.c

From NetHackWiki
Jump to: navigation, search

Below is the full text to util/panic.c from NetHack 3.4.3.

/*	SCCS Id: @(#)panic.c	3.4	1994/03/02	*/
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed.  See license for details. */

 *	This code was adapted from the code in end.c to run in a standalone
 *	mode for the makedefs / drg code.

#include "config.h"

#ifdef AZTEC
#define abort() exit()
#ifdef VMS
extern void NDECL(vms_abort);

boolean panicking;
void VDECL(panic, (char *,...));

panic VA_DECL(char *,str)
	VA_INIT(str, char *);
#ifdef SYSV
		abort();    /* avoid loops - this should never happen*/

	(void) fputs(" ERROR:  ", stderr);
	Vfprintf(stderr, str, VA_ARGS);
	(void) fflush(stderr);
#if defined(UNIX) || defined(VMS)
# ifdef SYSV
# endif
		    abort();	/* generate core dump */
	exit(EXIT_FAILURE);		/* redundant */

 * In case bison-generated foo_yacc.c tries to use alloca(); if we don't
 * have it then just use malloc() instead.  This may not work on some
 * systems, but they should either use yacc or get a real alloca routine.
long *alloca(cnt)
unsigned cnt;
	return cnt ? alloc(cnt) : (long *)0;


This page may need to be updated for NetHack 3.6.0.

It may contain text specific to NetHack 3.4.3. Information on this page may be out of date.

Editors: After reviewing this page and making necessary edits, please change the {{nethack-343}} tag to {{nethack-360}} or {{noversion}} as appropriate.