Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
ogs
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Özgür Ozan Sen
ogs
Commits
299b8cc3
Commit
299b8cc3
authored
8 years ago
by
Norihiro Watanabe
Browse files
Options
Downloads
Patches
Plain Diff
abort() in OGS_FATAL if OGS_FATAL_ABORT is defined
parent
0cfb3d81
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
BaseLib/Error.h
+15
-0
15 additions, 0 deletions
BaseLib/Error.h
with
15 additions
and
0 deletions
BaseLib/Error.h
+
15
−
0
View file @
299b8cc3
...
@@ -10,15 +10,30 @@
...
@@ -10,15 +10,30 @@
#ifndef BASELIB_ERROR_H
#ifndef BASELIB_ERROR_H
#define BASELIB_ERROR_H
#define BASELIB_ERROR_H
#ifdef OGS_FATAL_ABORT
#include
<cstdlib>
#endif
#include
<stdexcept>
#include
<stdexcept>
#ifdef OGS_FATAL_ABORT
#include
<logog/include/logog.hpp>
#endif
#include
"StringTools.h"
#include
"StringTools.h"
#include
"FileTools.h"
#include
"FileTools.h"
#define OGS_STR(x) #x
#define OGS_STR(x) #x
#define OGS_STRINGIFY(x) OGS_STR(x)
#define OGS_STRINGIFY(x) OGS_STR(x)
#define OGS_LOCATION " at " + BaseLib::extractBaseName(__FILE__) + ", line " OGS_STRINGIFY(__LINE__)
#define OGS_LOCATION " at " + BaseLib::extractBaseName(__FILE__) + ", line " OGS_STRINGIFY(__LINE__)
#ifdef OGS_FATAL_ABORT
#define OGS_FATAL(fmt, ...)\
{\
ERR("%s", BaseLib::format(fmt, ##__VA_ARGS__).data());\
std::abort();\
}
#else
#define OGS_FATAL(fmt, ...)\
#define OGS_FATAL(fmt, ...)\
throw std::runtime_error(BaseLib::format(fmt, ##__VA_ARGS__) + OGS_LOCATION);
throw std::runtime_error(BaseLib::format(fmt, ##__VA_ARGS__) + OGS_LOCATION);
#endif
#endif //BASELIB_ERROR_H
#endif //BASELIB_ERROR_H
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment