home *** CD-ROM | disk | FTP | other *** search
/ GEMini Atari / GEMini_Atari_CD-ROM_Walnut_Creek_December_1993.iso / files / gnu / libsrc87 / eprintf.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-07-30  |  988 b   |  41 lines

  1. #include <stdio.h>
  2. #include <stdarg.h>
  3. #include <string.h>
  4. #include "lib.h"
  5.  
  6. /* new file 4/15/92 sb
  7.    This function had to be split from the [vf]printf functions to accommodate
  8.    Sozobon's floating point libs.  Originally, anything that used the assert()
  9.    macro [like malloc()] would pull in this function and bring with it
  10.    definitions of printf et.al.; if we've already included the printf() from
  11.    libm.a, this will cause a conflict.
  12.  
  13.    5/2/92 sb
  14.    Modified to do its own work rather than call fprintf().
  15. */
  16.  
  17.  
  18. static char buf[20];    /* big enough for any value of a long */
  19.  
  20. static void _say(s)
  21. char *s;
  22. {
  23.     _write(2,s,(long)(strlen(s)));
  24. }
  25.  
  26. /* This is used by the `assert' macro.  */
  27. void __eprintf (expression, line, filename)
  28. const char *expression;
  29. const long line;
  30. const char *filename;
  31. {
  32.     _ltoa(line, buf, 10);
  33.     _say("assertion `");
  34.     _say(expression);
  35.     _say("' failed at line ");
  36.     _say(buf);
  37.     _say(" of file ");
  38.     _say(filename);
  39.     _say("\r\n");
  40. }
  41.