home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / detk45he.zip / libc / assert.h next >
Text File  |  1999-03-15  |  2KB  |  76 lines

  1. #if __IBMC__ || __IBMCPP__
  2. #pragma info( none )
  3. #ifndef __CHKHDR__
  4.    #pragma info( none )
  5. #endif
  6. #pragma info( restore )
  7. #endif
  8.  
  9. #ifndef __assert_h
  10.    #define __assert_h
  11.  
  12.    #ifdef __cplusplus
  13.       extern "C" {
  14.    #endif
  15.  
  16.    #ifndef  _LNK_CONV
  17.       #if __IBMC__ || __IBMCPP__ || defined(_OPTLINK_SUPPORTED)
  18.          #define _LNK_CONV   _Optlink
  19.       #else
  20.          #define _LNK_CONV
  21.       #endif
  22.    #endif
  23.  
  24.    #ifndef _IMPORT
  25.       #ifdef __IMPORTLIB__
  26.          #define _IMPORT _Import
  27.       #else
  28.          #define _IMPORT
  29.       #endif
  30.    #endif
  31.  
  32.    /********************************************************************/
  33.    /*  <assert.h> header file                                          */
  34.    /*                                                                  */
  35.    /*  (C) Copyright IBM Corp. 1991, 1995.                             */
  36.    /*  - Licensed Material - Program-Property of IBM                   */
  37.    /*  - All rights reserved                                           */
  38.    /*                                                                  */
  39.    /********************************************************************/
  40.  
  41.    #ifndef NDEBUG
  42.  
  43.       #ifdef assert
  44.          #undef assert
  45.       #endif
  46.  
  47.       extern void _IMPORT _LNK_CONV _assert( const char *, const char *, unsigned int );
  48.  
  49.       #define assert( expr ) \
  50.          ( ( expr ) ? ( void )0 : _assert( #expr, __FILE__, __LINE__ ) )
  51.  
  52.    #else
  53.  
  54.       #ifdef assert
  55.          #undef assert
  56.       #endif
  57.  
  58.       #define assert( ignore ) ( ( void )0 )
  59.  
  60.    #endif
  61.  
  62.    #ifdef __cplusplus
  63.       }
  64.    #endif
  65.  
  66. #endif
  67.  
  68. #if __IBMC__ || __IBMCPP__
  69. #pragma info( none )
  70. #ifndef __CHKHDR__
  71.    #pragma info( restore )
  72. #endif
  73. #pragma info( restore )
  74. #endif
  75.  
  76.