home *** CD-ROM | disk | FTP | other *** search
- /*
- File: DebugAssert.h
-
- Copyright: © 1991-1994 by Apple Computer, Inc.
- All rights reserved.
-
- Part of the AOCE Sample SMSAM Package. Consult the license
- which came with this software for your specific legal rights.
-
- */
-
-
-
- #ifndef __DEBUGASSERT__
- #define __DEBUGASSERT__
-
- #ifndef __TYPES__
- #include "Types.h"
- #endif
-
- /***********************************|****************************************/
-
- #define NOT_IMPLEMENTED() AssertDebug(0,"NOT IMPLEMENTED",__FILE__,__LINE__)
-
-
- #if defined ( DEBUG ) || defined ( debug )
-
- extern Boolean AssertDebug ( Boolean expr, const char* exprString, const char* file, unsigned long line );
-
- #define ASSERT(EXPR) AssertDebug(EXPR,#EXPR,__FILE__,__LINE__)
-
- #define ASSERT_RETURN(EXPR) \
- if (!AssertDebug (EXPR,#EXPR,__FILE__,__LINE__)) return
-
- #define ASSERT_RETURN_ZERO(EXPR) \
- if (!AssertDebug (EXPR,#EXPR,__FILE__,__LINE__)) return 0
-
- #define MARK(S) S << "\n\nFILE " << __FILE__ << "; LINE " << dec << __LINE__ << '\n'
-
- #else
-
- #define ASSERT(EXPR) (EXPR)
-
- #define ASSERT_RETURN(EXPR) if (!(EXPR)) return
-
- #define ASSERT_RETURN_ZERO(EXPR) if (!(EXPR)) return 0
-
- #define MARK(S)
-
- #endif
-
- /***********************************|****************************************/
-
- #endif // __DEBUGASSERT__
-