# define SIGKILL 9
#endif
+#include "v8.h" // NOLINT(build/include_order)
#include "node_version.h" // NODE_MODULE_VERSION
#include "node_object_wrap.h"
#include "node_internals.h"
#endif
-#include "uv.h"
-#include "v8.h"
-
#include <assert.h>
#ifndef NODE_STRINGIFY
v8::Handle<v8::Value>,
enum encoding encoding = BINARY);
-v8::Local<v8::Object> BuildStatsObject(const uv_stat_t* s);
-
-
#ifdef _WIN32
NODE_EXTERN v8::Local<v8::Value> WinapiErrnoException(int errorno,
const char *syscall = NULL, const char *msg = "",
const char *signo_string(int errorno);
-NODE_EXTERN typedef void (* addon_register_func)(
- v8::Handle<v8::Object> exports, v8::Handle<v8::Value> module);
+NODE_EXTERN typedef void (*addon_register_func)(
+ v8::Handle<v8::Object> exports,
+ v8::Handle<v8::Value> module);
+
+NODE_EXTERN typedef void (*addon_context_register_func)(
+ v8::Handle<v8::Object> exports,
+ v8::Handle<v8::Value> module,
+ v8::Handle<v8::Context> context);
struct node_module_struct {
int version;
void *dso_handle;
const char *filename;
node::addon_register_func register_func;
+ node::addon_context_register_func register_context_func;
const char *modname;
};
NODE_MODULE_EXPORT node::node_module_struct modname ## _module = \
{ \
NODE_STANDARD_MODULE_STUFF, \
- (node::addon_register_func)regfunc, \
+ (node::addon_register_func) (regfunc), \
+ NULL, \
+ NODE_STRINGIFY(modname) \
+ }; \
+ }
+
+#define NODE_MODULE_CONTEXT_AWARE(modname, regfunc) \
+ extern "C" { \
+ NODE_MODULE_EXPORT node::node_module_struct modname ## _module = \
+ { \
+ NODE_STANDARD_MODULE_STUFF, \
+ NULL, \
+ (regfunc), \
NODE_STRINGIFY(modname) \
}; \
}