home *** CD-ROM | disk | FTP | other *** search
/ The Datafile PD-CD 2 / DATAFILE_PDCD2.iso / utilities2 / unixlib36d / UnixLib36d / src / c / assert < prev    next >
Encoding:
Text File  |  1994-03-08  |  641 b   |  38 lines

  1. #ifdef __STDC__
  2. static char sccs_id[] = "@(#) assert.c 1.0 " __DATE__ " HJR";
  3. #else
  4. static char sccs_id[] = "@(#) assert.c 1.0 26/9/90 HJR";
  5. #endif
  6.  
  7. /* assert.c (c) Copyright 1990 H.Rogers */
  8.  
  9. #include <stdio.h>
  10. #include <signal.h>
  11. #include <assert.h>
  12.  
  13. #ifdef __STDC__
  14. int
  15. __fail (char *exp, char *file, int line)
  16. #else
  17. int
  18. __fail (exp, file, line)
  19.      char *exp;
  20.      char *file;
  21.      int line;
  22. #endif
  23. {
  24.   fprintf (stderr, "\n\"%s\", line %d: Assertion failed: %s\n", file, line, exp);
  25.   raise (SIGABRT);
  26.   return (0);
  27. }
  28.  
  29. #ifdef __STDC__
  30. void (assert) (register int x)
  31. #else
  32. void (assert) (x)
  33.      register int x;
  34. #endif
  35. {
  36.   assert (x);
  37. }
  38.