src/share/instrument/JPLISAssert.h

Print this page




  32  *  are free when turned off (all pre-processor stuff)
  33  */
  34 
  35 
  36 #ifndef _JPLISASSERT_H_
  37 #define _JPLISASSERT_H_
  38 
  39 #include    <jni.h>
  40 
  41 #ifdef __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 #define JPLISASSERT_ENABLEASSERTIONS    (1)
  46 
  47 
  48 #ifndef JPLISASSERT_ENABLEASSERTIONS
  49 #define JPLISASSERT_ENABLEASSERTIONS    (0)
  50 #endif
  51 




  52 
  53 #if JPLISASSERT_ENABLEASSERTIONS
  54 #define jplis_assert(x)             JPLISAssertCondition((jboolean)(x), #x, __FILE__, __LINE__)
  55 #define jplis_assert_msg(x, msg)    JPLISAssertConditionWithMessage((jboolean)(x), #x, msg, __FILE__, __LINE__)
  56 #else
  57 #define jplis_assert(x)
  58 #define jplis_assert_msg(x, msg)
  59 #endif
  60 
  61 /*
  62  * Test the supplied condition.
  63  * If false, print a constructed message including source site info to stderr.
  64  * If true, do nothing.
  65  */
  66 extern void
  67 JPLISAssertCondition(   jboolean        condition,
  68                         const char *    assertionText,
  69                         const char *    file,
  70                         int             line);
  71 
  72 /*
  73  * Test the supplied condition.
  74  * If false, print a constructed message including source site info
  75  * and the supplied message to stderr.


  32  *  are free when turned off (all pre-processor stuff)
  33  */
  34 
  35 
  36 #ifndef _JPLISASSERT_H_
  37 #define _JPLISASSERT_H_
  38 
  39 #include    <jni.h>
  40 
  41 #ifdef __cplusplus
  42 extern "C" {
  43 #endif
  44 
  45 #define JPLISASSERT_ENABLEASSERTIONS    (1)
  46 
  47 
  48 #ifndef JPLISASSERT_ENABLEASSERTIONS
  49 #define JPLISASSERT_ENABLEASSERTIONS    (0)
  50 #endif
  51 
  52 /* Use THIS_FILE when it is available. */
  53 #ifndef THIS_FILE
  54     #define THIS_FILE __FILE__
  55 #endif
  56 
  57 #if JPLISASSERT_ENABLEASSERTIONS
  58 #define jplis_assert(x)             JPLISAssertCondition((jboolean)(x), #x, THIS_FILE, __LINE__)
  59 #define jplis_assert_msg(x, msg)    JPLISAssertConditionWithMessage((jboolean)(x), #x, msg, THIS_FILE, __LINE__)
  60 #else
  61 #define jplis_assert(x)
  62 #define jplis_assert_msg(x, msg)
  63 #endif
  64 
  65 /*
  66  * Test the supplied condition.
  67  * If false, print a constructed message including source site info to stderr.
  68  * If true, do nothing.
  69  */
  70 extern void
  71 JPLISAssertCondition(   jboolean        condition,
  72                         const char *    assertionText,
  73                         const char *    file,
  74                         int             line);
  75 
  76 /*
  77  * Test the supplied condition.
  78  * If false, print a constructed message including source site info
  79  * and the supplied message to stderr.