jdk/src/share/native/sun/awt/debug/debug_assert.h
changeset 13678 5c8001201f98
parent 5506 202f599c92aa
child 23010 6dadb192ad81
equal deleted inserted replaced
13508:7c6aa31ff1b2 13678:5c8001201f98
    30 extern "C" {
    30 extern "C" {
    31 #endif
    31 #endif
    32 
    32 
    33 #include "debug_util.h"
    33 #include "debug_util.h"
    34 
    34 
       
    35 /* Use THIS_FILE when it is available. */
       
    36 #ifndef THIS_FILE
       
    37     #define THIS_FILE __FILE__
       
    38 #endif
       
    39 
    35 #if defined(DEBUG)
    40 #if defined(DEBUG)
    36 
    41 
    37 #define DASSERT(_expr) \
    42 #define DASSERT(_expr) \
    38         if ( !(_expr) ) { \
    43         if ( !(_expr) ) { \
    39             DAssert_Impl( #_expr, __FILE__, __LINE__); \
    44             DAssert_Impl( #_expr, THIS_FILE, __LINE__); \
    40         } else { \
    45         } else { \
    41         }
    46         }
    42 
    47 
    43 #define DASSERTMSG(_expr, _msg) \
    48 #define DASSERTMSG(_expr, _msg) \
    44         if ( !(_expr) ) { \
    49         if ( !(_expr) ) { \
    45             DAssert_Impl( (_msg), __FILE__, __LINE__); \
    50             DAssert_Impl( (_msg), THIS_FILE, __LINE__); \
    46         } else { \
    51         } else { \
    47         }
    52         }
    48 
    53 
    49 /* prototype for assert function */
    54 /* prototype for assert function */
    50 typedef void (*DASSERT_CALLBACK)(const char * msg, const char * file, int line);
    55 typedef void (*DASSERT_CALLBACK)(const char * msg, const char * file, int line);