[18190] | 1 | /* GMP assertion failure handler. |
---|
[15293] | 2 | |
---|
[18190] | 3 | THE FUNCTIONS IN THIS FILE ARE FOR INTERNAL USE ONLY. THEY'RE ALMOST |
---|
| 4 | CERTAIN TO BE SUBJECT TO INCOMPATIBLE CHANGES OR DISAPPEAR COMPLETELY IN |
---|
| 5 | FUTURE GNU MP RELEASES. |
---|
[15293] | 6 | |
---|
[18190] | 7 | Copyright 2000, 2001 Free Software Foundation, Inc. |
---|
| 8 | |
---|
[15293] | 9 | This file is part of the GNU MP Library. |
---|
| 10 | |
---|
| 11 | The GNU MP Library is free software; you can redistribute it and/or modify |
---|
| 12 | it under the terms of the GNU Lesser General Public License as published by |
---|
| 13 | the Free Software Foundation; either version 2.1 of the License, or (at your |
---|
| 14 | option) any later version. |
---|
| 15 | |
---|
| 16 | The GNU MP Library is distributed in the hope that it will be useful, but |
---|
| 17 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY |
---|
| 18 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public |
---|
| 19 | License for more details. |
---|
| 20 | |
---|
| 21 | You should have received a copy of the GNU Lesser General Public License |
---|
| 22 | along with the GNU MP Library; see the file COPYING.LIB. If not, write to |
---|
| 23 | the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, |
---|
[18190] | 24 | MA 02111-1307, USA. */ |
---|
[15293] | 25 | |
---|
| 26 | #include <stdio.h> |
---|
[18190] | 27 | #include <stdlib.h> |
---|
[15293] | 28 | #include "gmp.h" |
---|
| 29 | #include "gmp-impl.h" |
---|
| 30 | |
---|
| 31 | |
---|
[18190] | 32 | void |
---|
| 33 | __gmp_assert_header (const char *filename, int linenum) |
---|
[15293] | 34 | { |
---|
| 35 | if (filename != NULL && filename[0] != '\0') |
---|
| 36 | { |
---|
| 37 | fprintf (stderr, "%s:", filename); |
---|
| 38 | if (linenum != -1) |
---|
| 39 | fprintf (stderr, "%d: ", linenum); |
---|
| 40 | } |
---|
[18190] | 41 | } |
---|
[15293] | 42 | |
---|
[18190] | 43 | void |
---|
| 44 | __gmp_assert_fail (const char *filename, int linenum, |
---|
| 45 | const char *expr) |
---|
| 46 | { |
---|
| 47 | __gmp_assert_header (filename, linenum); |
---|
[15293] | 48 | fprintf (stderr, "GNU MP assertion failed: %s\n", expr); |
---|
| 49 | abort(); |
---|
| 50 | } |
---|