home *** CD-ROM | disk | FTP | other *** search
/ PC Extra Super CD 1998 January / PCPLUS131.iso / DJGPP / V2 / DJLSR201.ZIP / src / libc / ansi / assert / assert.c next >
Encoding:
C/C++ Source or Header  |  1994-11-29  |  375 b   |  14 lines

  1. /* Copyright (C) 1994 DJ Delorie, see COPYING.DJ for details */
  2. #include <assert.h>
  3. #include <stdio.h>
  4. #include <signal.h>
  5. #include <stdlib.h>
  6.  
  7. void    __dj_assert(const char *msg, const char *file, int line)
  8. {
  9.   /* Assertion failed at foo.c line 45: x<y */
  10.   fprintf(stderr, "Assertion failed at %s line %d: %s\n", file, line, msg);
  11.   raise(SIGABRT);
  12.   exit(1);
  13. }
  14.