Except.xcc

Benoit Dupont de Dinechin (Benoit.Dupont-de-Dinechin@st.com)

Copyright 2007 STMicroelectronics. Copyright 1995 - 1998 Commissariat a l'Energie Atomique.

This program is free software; you can redistribute it and/or modify it under the terms of either (at your option): the GNU General Public License (GPL) version 2; the GNU Lesser General Public License (LGPL) version 2.1; any later version of these licences as published by the Free Software Foundation.

CDT_OPTIMIZE— Define to disable checks.
#ifdef CDT_OPTIMIZE
# if (CDT_OPTIMIZE >= 1)
#  define Except_CHECK(expression)
#  define Except_INVARIANT(expression)
# endif
# if (CDT_OPTIMIZE >= 2)
#  define Except_ENSURE(expression)
#  define Except_REQUIRE(expression)
# endif
# if (CDT_OPTIMIZE >= 3)
#  define Except_NEVER(expression)      do { if (expression) abort(); } while (0)
#  define Except_ALWAYS(expression)     do { if (expression); else abort(); } while (0)
# endif
#endif//CDT_OPTIMIZE

Except_THROW -- Throw an exception with a string.

@XCC.hExcept_NEVER— Inline assertion that expression is never true.
Except_ALWAYS— Inline assertion that expression is always true.
Except_REQUIRE— Check method pre-condition.
Except_ENSURE— Check method post-condition.
Except_INVARIANT— Check loop invariant.
Except_CHECK— Used for any other inline checks.
Except_DEBUG— Used for heavy debug checks.
#ifndef Except_THROW
# define Except_THROW(exception) \
  (exit(fprintf(stderr, #exception "\t" __FILE__ ":%d:\n", __LINE__)), 0)
#endif//Except_THROW
#ifndef Except_NEVER
# define Except_NEVER(expression)       ASSERT(!(expression));
#endif//Except_NEVER
#ifndef Except_ALWAYS
# define Except_ALWAYS(expression)      ASSERT(expression);
#endif//Except_ALWAYS
#ifndef Except_REQUIRE
# define Except_REQUIRE(expression)     ASSERT(expression)
#endif//Except_REQUIRE
#ifndef Except_ENSURE
# define Except_ENSURE(expression)      ASSERT(expression)
#endif//Except_ENSURE
#ifndef Except_INVARIANT
# define Except_INVARIANT(expression)   ASSERT(expression)
#endif//Except_INVARIANT
#ifndef Except_CHECK
# define Except_CHECK(expression)       ASSERT(expression)
#endif//Except_CHECK
#if CDT_DEBUG
# define Except_DEBUG(expression)       ASSERT(expression)
#else//CDT_DEBUG
# define Except_DEBUG(expression)
#endif//CDT_DEBUG