| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 517e715 commit b8919b1
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -1788,8 +1788,15 @@ void GetActiveHandles(const FunctionCallbackInfo<Value>& args) { | |||
| 1788 | 1788 | } | |
| 1789 | 1789 | ||
| 1790 | 1790 | ||
| 1791 | + NO_RETURN void Abort() { | ||
| 1792 | + DumpBacktrace(stderr); | ||
| 1793 | + fflush(stderr); | ||
| 1794 | + ABORT_NO_BACKTRACE(); | ||
| 1795 | + } | ||
| 1796 | + | ||
| 1797 | + | ||
| 1791 | 1798 | static void Abort(const FunctionCallbackInfo<Value>& args) { | |
| 1792 | - ABORT(); | ||
| 1799 | + Abort(); | ||
| 1793 | 1800 | } | |
| 1794 | 1801 | ||
| 1795 | 1802 | ||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -134,12 +134,10 @@ constexpr size_t arraysize(const T(&)[N]) { return N; } | |||
| 134 | 134 | # define ROUND_UP(a, b) ((a) % (b) ? ((a) + (b)) - ((a) % (b)) : (a)) | |
| 135 | 135 | #endif | |
| 136 | 136 | ||
| 137 | - #if defined(__GNUC__) && __GNUC__ >= 4 | ||
| 137 | + #ifdef __GNUC__ | ||
| 138 | 138 | # define MUST_USE_RESULT __attribute__((warn_unused_result)) | |
| 139 | - # define NO_RETURN __attribute__((noreturn)) | ||
| 140 | 139 | #else | |
| 141 | 140 | # define MUST_USE_RESULT | |
| 142 | - # define NO_RETURN | ||
| 143 | 141 | #endif | |
| 144 | 142 | ||
| 145 | 143 | bool IsExceptionDecorated(Environment* env, v8::Local<v8::Value> er); | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -19,6 +19,13 @@ | |||
| 19 | 19 | ||
| 20 | 20 | namespace node { | |
| 21 | 21 | ||
| 22 | + #ifdef __GNUC__ | ||
| 23 | + #define NO_RETURN __attribute__((noreturn)) | ||
| 24 | + #else | ||
| 25 | + #define NO_RETURN | ||
| 26 | + #endif | ||
| 27 | + | ||
| 28 | + NO_RETURN void Abort(); | ||
| 22 | 29 | void DumpBacktrace(FILE* fp); | |
| 23 | 30 | ||
| 24 | 31 | #ifdef __APPLE__ | |
@@ -43,12 +50,7 @@ template <typename T> using remove_reference = std::remove_reference<T>; | |||
| 43 | 50 | #define ABORT_NO_BACKTRACE() abort() | |
| 44 | 51 | #endif | |
| 45 | 52 | ||
| 46 | - #define ABORT() \ | ||
| 47 | - do { \ | ||
| 48 | - node::DumpBacktrace(stderr); \ | ||
| 49 | - fflush(stderr); \ | ||
| 50 | - ABORT_NO_BACKTRACE(); \ | ||
| 51 | - } while (0) | ||
| 53 | + #define ABORT() node::Abort() | ||
| 52 | 54 | ||
| 53 | 55 | #if defined(NDEBUG) | |
| 54 | 56 | # define ASSERT(expression) | |
| Back | FazBrowse Home | New Git URL |
0 commit comments