Skip to content

Commit 2fcea5b

Browse files
Small inclusion fix for <exception> (#109)
Fixed inclusion of the exception header in napi.h
1 parent a2a6570 commit 2fcea5b

File tree

1 file changed

+5
-0
lines changed
  • Core/Node-API/Include/Shared/napi

1 file changed

+5
-0
lines changed

Core/Node-API/Include/Shared/napi/napi.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@
3636
#endif // NAPI_HAS_THREADS
3737
#include <string>
3838
#include <vector>
39+
#ifdef NAPI_CPP_EXCEPTIONS
40+
#include <exception>
41+
#endif // NAPI_CPP_EXCEPTIONS
3942

4043
// VS2015 RTM has bugs with constexpr, so require min of VS2015 Update 3 (known
4144
// good version)
@@ -1847,10 +1850,12 @@ class Error : public ObjectReference
18471850
static Error New(napi_env env, const char* message);
18481851
static Error New(napi_env env, const std::string& message);
18491852

1853+
#ifdef NAPI_CPP_EXCEPTIONS
18501854
// [BABYLON-NATIVE-ADDITION]
18511855
static Error New(napi_env env, const std::exception& exception);
18521856
// [BABYLON-NATIVE-ADDITION]
18531857
static Error New(napi_env env, const std::exception_ptr& exception_ptr);
1858+
#endif // NAPI_CPP_EXCEPTIONS
18541859

18551860
static NAPI_NO_RETURN void Fatal(const char* location, const char* message);
18561861

0 commit comments

Comments
 (0)