diff options
author | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-08-25 09:58:24 +0000 |
---|---|---|
committer | vlefevre <vlefevre@280ebfd0-de03-0410-8827-d642c229c3f4> | 2001-08-25 09:58:24 +0000 |
commit | 6c33f0642400d2063453f1dcedcfa56648002384 (patch) | |
tree | dc7b17b7843317b46342ff7fd2f3d3f6ef0b8052 /mpfr-impl.h | |
parent | 378003d0c2d6362039b98ecda0d81625ffc1a394 (diff) | |
download | mpfr-6c33f0642400d2063453f1dcedcfa56648002384.tar.gz |
Assertion support with debug level.
git-svn-id: svn://scm.gforge.inria.fr/svn/mpfr/trunk@1146 280ebfd0-de03-0410-8827-d642c229c3f4
Diffstat (limited to 'mpfr-impl.h')
-rw-r--r-- | mpfr-impl.h | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mpfr-impl.h b/mpfr-impl.h index 8e72fd5cc..94ab65356 100644 --- a/mpfr-impl.h +++ b/mpfr-impl.h @@ -26,6 +26,18 @@ typedef unsigned int mp_exp_unsigned_t; typedef unsigned long int mp_exp_unsigned_t; #endif +/* Assertions */ + +#ifndef MPFR_DEBUG_LEVEL +#define MPFR_DEBUG_LEVEL 20 +#endif + +#include <assert.h> +#define MPFR_ASSERT(level, expr) \ + ((level) < MPFR_DEBUG_LEVEL && (assert(expr), 0)) +#define MPFR_ASSERTN(expr) MPFR_ASSERT(16, expr) +#define MPFR_ASSERTD(expr) MPFR_ASSERT(32, expr) + /* Definition of constants */ #define LOG2 0.69314718055994528622 /* log(2) rounded to zero on 53 bits */ |