Remove function core_error()

This commit is contained in:
Andreas Fabri 2023-03-10 09:09:46 +00:00
parent 89c9f902ff
commit 345e63921d
2 changed files with 0 additions and 31 deletions

View File

@ -156,12 +156,6 @@ CGAL_CORE_EXPORT double IntMantissa(double d);
// (See CORE_PATH/progs/ieee/frexp.cpp for details)
CGAL_CORE_EXPORT int IntExponent(double d);
/// Writes out an error or warning message in the local file CORE_DIAGFILE
/** If last argument (err) is TRUE, then this is considered an error
* (not just warning). In this case, the message is also printed in
* std::cerr, using std::perror().
* */
CGAL_CORE_EXPORT void core_error(std::string msg, std::string file, int lineno, bool err);
/// This is for debugging messages
inline void core_debug(std::string msg){

View File

@ -157,30 +157,5 @@ int IntExponent(double d) {
return e-53;
}
/// core_error is the method to write Core Library warning or error messages
/** Both warnings and errors are written to a file called CORE_DIAGFILE.
* But errors are also written on std::cerr (similar to std::perror()).
* */
// Usage: core_error(message, file_with_error, line_number, err_type)
// where err_type=0 means WARNING, error_type=0 means ERROR
CGAL_INLINE_FUNCTION
void core_error(std::string msg, std::string file, int lineno, bool err) {
std::ofstream outFile(CORE_DIAGFILE, std::ios::app); // open to append
if (!outFile) {
// perror("CORE ERROR: cannot open Core Diagnostics file");
std::cerr << "CORE ERROR: can't open Core Diagnostics file"<<std::endl;
std::exit(1); //Note: do not call abort()
}
outFile << "CORE " << (err? "ERROR" : "WARNING")
<< " (at " << file << ": " << lineno << "): "
<< msg << std::endl;
outFile.close();
if (err) {
(std::string("CORE ERROR") + " (file " + file + ", line "
+ std::to_string(lineno) +"):" + msg + "\n").c_str();
std::exit(1); //Note: do not call abort()
}
}
} //namespace CORE