1 /**************************************************************************/
2 /* Copyright 2009 Tim Day */
3 /* */
4 /* This file is part of Fracplanet */
5 /* */
6 /* Fracplanet is free software: you can redistribute it and/or modify */
7 /* it under the terms of the GNU General Public License as published by */
8 /* the Free Software Foundation, either version 3 of the License, or */
9 /* (at your option) any later version. */
10 /* */
11 /* Fracplanet is distributed in the hope that it will be useful, */
12 /* but WITHOUT ANY WARRANTY; without even the implied warranty of */
13 /* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the */
14 /* GNU General Public License for more details. */
15 /* */
16 /* You should have received a copy of the GNU General Public License */
17 /* along with Fracplanet. If not, see <http://www.gnu.org/licenses/>. */
18 /**************************************************************************/
19
20 #include "common.h"
21
fatal_error(const char * msg)22 void fatal_error(const char* msg)
23 {
24 std::cerr
25 << "\n*** Fatal error: "
26 << msg
27 << " ***\n";
28 exit(1);
29 }
30
fatal_internal_error(const char * src_file,uint src_line)31 void fatal_internal_error(const char* src_file,uint src_line)
32 {
33 std::cerr
34 << "\n*** Fatal internal error in "
35 << src_file
36 << " at line "
37 << src_line
38 << " ***\n";
39 exit(1);
40 }
41
constraint_violation(const char * test,const char * src_file,uint src_line)42 void constraint_violation(const char* test,const char* src_file,uint src_line)
43 {
44 std::cerr
45 << "\n*** Constraint \""
46 << test
47 << "\" violated in file"
48 << src_file
49 << " at line "
50 << src_line
51 << " ***\n";
52 exit(1);
53 }
54