1 /*********************                                                        */
2 /*! \file cvc4_check.cpp
3  ** \verbatim
4  ** Top contributors (to current version):
5  **   Tim King
6  ** This file is part of the CVC4 project.
7  ** Copyright (c) 2009-2019 by the authors listed in the file AUTHORS
8  ** in the top-level source directory) and their institutional affiliations.
9  ** All rights reserved.  See the file COPYING in the top-level source
10  ** directory for licensing information.\endverbatim
11  **
12  ** \brief Assertion utility classes, functions and macros.
13  **
14  ** Implementation of assertion utility classes, functions and macros.
15  **/
16 
17 #include "base/cvc4_check.h"
18 
19 #include <cstdlib>
20 #include <iostream>
21 
22 namespace CVC4 {
23 
FatalStream(const char * function,const char * file,int line)24 FatalStream::FatalStream(const char* function, const char* file, int line)
25 {
26   stream() << "Fatal failure within " << function << " at " << file << ":"
27            << line << "\n";
28 }
29 
~FatalStream()30 FatalStream::~FatalStream()
31 {
32   Flush();
33   abort();
34 }
35 
stream()36 std::ostream& FatalStream::stream() { return std::cerr; }
37 
Flush()38 void FatalStream::Flush()
39 {
40   stream() << std::endl;
41   stream().flush();
42 }
43 
44 }  // namespace CVC4
45