home *** CD-ROM | disk | FTP | other *** search
/ SPACE 2 / SPACE - Library 2 - Volume 1.iso / program / 316 / libsrc / abort.c next >
Encoding:
C/C++ Source or Header  |  1988-10-20  |  528 b   |  27 lines

  1.  
  2. #include <stdio.h>
  3.  
  4. extern FILE * stderr;
  5.  
  6. abort()
  7. {
  8.   int * stackp;
  9.   int i;
  10.  
  11.   stackp = (int * )&stackp;
  12.   printf(stderr, "\n\n!!! Aborting!!! stack = \n");
  13.   for(i = 0 ; i < 16 ; i++)
  14.       printf("%lx: %lx\n", stackp, *stackp++);
  15.   exit(-999);
  16. }
  17.  
  18. _abort_internal(line, file)
  19. int line;
  20. char * file;
  21. {
  22.   fprintf(stderr, "Aborting at line %d of file %s\n", line, file);
  23.   abort();        /* note that this won't work of compile this
  24.                with the define that got us to this fun in
  25.                the first place */
  26. }
  27.