RSA BSAFE Micro Edition Suite

Streamlined security for mobile and embedded devices

Search  Print

r_assert.h

Go to the documentation of this file.
00001 /* $Id: r_assert.h,v 1.11 2004/09/27 06:27:24 sparki Exp $ */
00002 /*
00003  * Copyright (C) 1998-2003 RSA Security Inc. All rights reserved. 
00004  *
00005  * This work contains proprietary information of RSA Security. 
00006  * Distribution is limited to authorized licensees of RSA 
00007  * Security. Any unauthorized reproduction, distribution or 
00008  * modification of this work is strictly prohibited.
00009  */
00010 
00016 #undef r_assert
00017 
00018 /* The following is a 'portable' abort for platforms with memory
00019  * write protection for byte 0 in memory
00020  */
00021 /*
00022 #define abort(X) { char *nullp=NULL; *nullp='z'; }
00023 */
00024 
00025 #if defined(OPT_R_ASSERT) || defined(DEBUG)
00026 #define r_assert(c)                                                     \
00027         if (!(c)) {                                                     \
00028                 fprintf(stderr, __FILE__":%d: failed assertion `%s'\n", \
00029                         __LINE__, #c);                                  \
00030                 abort(); /*R_ASSERT*/                                   \
00031         }
00032 #else /* !(defined(OPT_R_ASSERT) || defined(DEBUG)) */
00033 #define r_assert(c)
00034 #endif /* defined(OPT_R_ASSERT) || defined(DEBUG) */
00035 

Copyright (c) 1999-2005 RSA Security Inc. All rights reserved. 072-001001-2100-001-000 - 2.1