home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / unix / unixlib_1 / !UnixLib37_src_clib_h_assert < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-09  |  974 b   |  45 lines

  1. /****************************************************************************
  2.  *
  3.  * $Source: /unixb/home/unixlib/source/unixlib37/src/clib/h/RCS/assert,v $
  4.  * $Date: 1996/10/30 21:58:58 $
  5.  * $Revision: 1.2 $
  6.  * $State: Rel $
  7.  * $Author: unixlib $
  8.  *
  9.  * $Log: assert,v $
  10.  * Revision 1.2  1996/10/30 21:58:58  unixlib
  11.  * Massive changes made by Nick Burret and Peter Burwood.
  12.  *
  13.  * Revision 1.1  1996/04/19 21:02:57  simon
  14.  * Initial revision
  15.  *
  16.  ***************************************************************************/
  17.  
  18. /* ANSI Standard: 4.2 Diagnostics <assert.h>.  */
  19.  
  20. #ifndef __ASSERT_H
  21. #define __ASSERT_H
  22.  
  23. #ifdef __cplusplus
  24. extern "C" {
  25. #endif
  26.  
  27. #ifdef NDEBUG
  28. #define assert(x) ((void) 0)
  29. #else
  30. extern    int        __fail(char *,char *,int);
  31. #ifdef __STDC__
  32. #define assert(x)    (void)((x) ? 0 : __fail(#x,__FILE__,__LINE__))
  33. #else
  34. #define assert(x)    (void)((x) ? 0 : __fail("x",__FILE__,__LINE__))
  35. #endif
  36. #endif
  37.  
  38. extern void (assert)(int);
  39.  
  40. #ifdef __cplusplus
  41.     }
  42. #endif
  43.  
  44. #endif
  45.