summaryrefslogtreecommitdiff
path: root/src/node.h
diff options
context:
space:
mode:
authorJames M Snell <jasnell@gmail.com>2018-05-16 14:24:25 -0700
committerJames M Snell <jasnell@gmail.com>2018-05-19 10:42:00 -0700
commit9349e15daa803fc626581802fa827afe8d00340e (patch)
tree906e49e854a2509e4ca1466f4042039afd2e294c /src/node.h
parentc68e6e1f1b4c70bf60485d20b6d4c9778dbbc551 (diff)
downloadandroid-node-v8-9349e15daa803fc626581802fa827afe8d00340e.tar.gz
android-node-v8-9349e15daa803fc626581802fa827afe8d00340e.tar.bz2
android-node-v8-9349e15daa803fc626581802fa827afe8d00340e.zip
src: move *Exceptions out to separate cc/h
PR-URL: https://github.com/nodejs/node/pull/20789 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Daniel Bevenius <daniel.bevenius@gmail.com> Reviewed-By: Gus Caplan <me@gus.host> Reviewed-By: Tiancheng "Timothy" Gu <timothygu99@gmail.com>
Diffstat (limited to 'src/node.h')
-rw-r--r--src/node.h103
1 files changed, 2 insertions, 101 deletions
diff --git a/src/node.h b/src/node.h
index e10e393cd6..d4b9346451 100644
--- a/src/node.h
+++ b/src/node.h
@@ -22,16 +22,6 @@
#ifndef SRC_NODE_H_
#define SRC_NODE_H_
-#ifdef _WIN32
-# ifndef BUILDING_NODE_EXTENSION
-# define NODE_EXTERN __declspec(dllexport)
-# else
-# define NODE_EXTERN __declspec(dllimport)
-# endif
-#else
-# define NODE_EXTERN /* nothing */
-#endif
-
#ifdef BUILDING_NODE_EXTENSION
# undef BUILDING_V8_SHARED
# undef BUILDING_UV_SHARED
@@ -60,40 +50,12 @@
# define SIGKILL 9
#endif
+#include "core.h" // NOLINT(build/include_order)
#include "v8.h" // NOLINT(build/include_order)
#include "v8-platform.h" // NOLINT(build/include_order)
#include "node_version.h" // NODE_MODULE_VERSION
#include "callback_scope.h"
-
-#define NODE_MAKE_VERSION(major, minor, patch) \
- ((major) * 0x1000 + (minor) * 0x100 + (patch))
-
-#ifdef __clang__
-# define NODE_CLANG_AT_LEAST(major, minor, patch) \
- (NODE_MAKE_VERSION(major, minor, patch) <= \
- NODE_MAKE_VERSION(__clang_major__, __clang_minor__, __clang_patchlevel__))
-#else
-# define NODE_CLANG_AT_LEAST(major, minor, patch) (0)
-#endif
-
-#ifdef __GNUC__
-# define NODE_GNUC_AT_LEAST(major, minor, patch) \
- (NODE_MAKE_VERSION(major, minor, patch) <= \
- NODE_MAKE_VERSION(__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__))
-#else
-# define NODE_GNUC_AT_LEAST(major, minor, patch) (0)
-#endif
-
-#if NODE_CLANG_AT_LEAST(2, 9, 0) || NODE_GNUC_AT_LEAST(4, 5, 0)
-# define NODE_DEPRECATED(message, declarator) \
- __attribute__((deprecated(message))) declarator
-#elif defined(_MSC_VER)
-# define NODE_DEPRECATED(message, declarator) \
- __declspec(deprecated) declarator
-#else
-# define NODE_DEPRECATED(message, declarator) \
- declarator
-#endif
+#include "exceptions.h"
// Forward-declare libuv loop
struct uv_loop_s;
@@ -107,47 +69,6 @@ class TracingController;
// terminally confused when it's done in node_internals.h
namespace node {
-NODE_EXTERN v8::Local<v8::Value> ErrnoException(v8::Isolate* isolate,
- int errorno,
- const char* syscall = nullptr,
- const char* message = nullptr,
- const char* path = nullptr);
-NODE_EXTERN v8::Local<v8::Value> UVException(v8::Isolate* isolate,
- int errorno,
- const char* syscall = nullptr,
- const char* message = nullptr,
- const char* path = nullptr);
-NODE_EXTERN v8::Local<v8::Value> UVException(v8::Isolate* isolate,
- int errorno,
- const char* syscall,
- const char* message,
- const char* path,
- const char* dest);
-
-NODE_DEPRECATED("Use ErrnoException(isolate, ...)",
- inline v8::Local<v8::Value> ErrnoException(
- int errorno,
- const char* syscall = nullptr,
- const char* message = nullptr,
- const char* path = nullptr) {
- return ErrnoException(v8::Isolate::GetCurrent(),
- errorno,
- syscall,
- message,
- path);
-})
-
-inline v8::Local<v8::Value> UVException(int errorno,
- const char* syscall = nullptr,
- const char* message = nullptr,
- const char* path = nullptr) {
- return UVException(v8::Isolate::GetCurrent(),
- errorno,
- syscall,
- message,
- path);
-}
-
/*
* These methods need to be called in a HandleScope.
*
@@ -452,26 +373,6 @@ NODE_DEPRECATED("Use DecodeWrite(isolate, ...)",
return DecodeWrite(v8::Isolate::GetCurrent(), buf, buflen, val, encoding);
})
-#ifdef _WIN32
-NODE_EXTERN v8::Local<v8::Value> WinapiErrnoException(
- v8::Isolate* isolate,
- int errorno,
- const char *syscall = nullptr,
- const char *msg = "",
- const char *path = nullptr);
-
-NODE_DEPRECATED("Use WinapiErrnoException(isolate, ...)",
- inline v8::Local<v8::Value> WinapiErrnoException(int errorno,
- const char *syscall = nullptr, const char *msg = "",
- const char *path = nullptr) {
- return WinapiErrnoException(v8::Isolate::GetCurrent(),
- errorno,
- syscall,
- msg,
- path);
-})
-#endif
-
const char *signo_string(int errorno);