-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmtypes.cpp
More file actions
26 lines (23 loc) · 863 Bytes
/
mtypes.cpp
File metadata and controls
26 lines (23 loc) · 863 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
/*
* Copyright (C) 2017 NEC Laboratories America, Inc. ("NECLA"). All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree. An additional grant of patent rights
* can be found in the PATENTS file in the same directory.
*/
#include "mtypes.hpp"
#include <iostream>
#include <sstream>
#include <stdexcept>
int malt2_err_fun( bool Abort, const int Line, const std::string& File, const std::string& Func, const std::string& Msg )
{
//std::cout << Msg << File << Line << Func << Abort << std::endl;
std::ostringstream oss;
oss << (Abort? "Error: ": "Warning: ") << Msg << File << ":" << Line << " " << Func << std::endl;
std::cout<<oss.str();
std::cout.flush();
if( 1 && Abort ){
throw std::runtime_error( oss.str() );
}
return 0;
}