Skip to content
This repository has been archived by the owner on Mar 4, 2020. It is now read-only.

Commit

Permalink
fix: Export node::Abort and Assert
Browse files Browse the repository at this point in the history
  • Loading branch information
nitsakh committed Apr 11, 2019
1 parent d203c7f commit b6351ea
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/node_errors.cc
Original file line number Diff line number Diff line change
Expand Up @@ -160,13 +160,13 @@ void AppendExceptionLine(Environment* env,
.FromMaybe(false));
}

[[noreturn]] void Abort() {
[[noreturn]] void NODE_EXTERN Abort() {
DumpBacktrace(stderr);
fflush(stderr);
ABORT_NO_BACKTRACE();
}

[[noreturn]] void Assert(const AssertionInfo& info) {
[[noreturn]] void NODE_EXTERN Assert(const AssertionInfo& info) {
char name[1024];
GetHumanReadableProcessName(&name);

Expand Down
5 changes: 3 additions & 2 deletions src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@

#if defined(NODE_WANT_INTERNALS) && NODE_WANT_INTERNALS

#include "node.h"
#include "node_persistent.h"
#include "v8.h"

Expand Down Expand Up @@ -93,8 +94,8 @@ struct AssertionInfo {
const char* message;
const char* function;
};
[[noreturn]] void Assert(const AssertionInfo& info);
[[noreturn]] void Abort();
[[noreturn]] void NODE_EXTERN Assert(const AssertionInfo& info);
[[noreturn]] void NODE_EXTERN Abort();
void DumpBacktrace(FILE* fp);

// Windows 8+ does not like abort() in Release mode
Expand Down

0 comments on commit b6351ea

Please sign in to comment.