home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 5 Edit / 05-Edit.zip / anwor032.zip / antiword.0.32 / fail.c < prev    next >
C/C++ Source or Header  |  1998-10-23  |  613b  |  27 lines

  1. /*
  2.  * fail.c
  3.  * Copyright (C) 1998 A.J. van Os
  4.  *
  5.  * Description:
  6.  * An alternative form of assert()
  7.  */
  8.  
  9. #include <stdlib.h>
  10. #include "antiword.h"
  11.  
  12. #if !defined(NDEBUG)
  13. void
  14. __fail(char *szExpression, char *szFilename, int iLineNumber)
  15. {
  16.     if (szExpression == NULL || szFilename == NULL) {
  17.         werr(1, "Internal error: no expression");
  18.     }
  19. #if defined(DEBUG)
  20.     fprintf(stderr, "%s[%3d]: Internal error in '%s'\n",
  21.         szFilename, iLineNumber, szExpression);
  22. #endif /* DEBUG */
  23.     werr(1, "Internal error in '%s' in file %s at line %d",
  24.         szExpression, szFilename, iLineNumber);
  25. } /* end of __fail */
  26. #endif /* !NDEBUG */
  27.