summaryrefslogtreecommitdiffhomepage
path: root/src/nodejs
diff options
context:
space:
mode:
authorAlexander Borisov <alexander.borisov@nginx.com>2018-12-19 15:56:57 +0300
committerAlexander Borisov <alexander.borisov@nginx.com>2018-12-19 15:56:57 +0300
commitd6f38a3268dd4df717bdb9054f3f9ee47fa1f429 (patch)
tree2e98fedf75a53ef5a34d3aedf7f7c547fe5a31a2 /src/nodejs
parentc55f329ecf8d32bad0d5bc2aae1da1522b3a92f8 (diff)
downloadunit-d6f38a3268dd4df717bdb9054f3f9ee47fa1f429.tar.gz
unit-d6f38a3268dd4df717bdb9054f3f9ee47fa1f429.tar.bz2
Node.js: added check for libunit version at compile time.
Diffstat (limited to 'src/nodejs')
-rw-r--r--src/nodejs/unit-http/package.json9
-rw-r--r--src/nodejs/unit-http/unit.h9
2 files changed, 12 insertions, 6 deletions
diff --git a/src/nodejs/unit-http/package.json b/src/nodejs/unit-http/package.json
index 6a2cd27c..13c91018 100644
--- a/src/nodejs/unit-http/package.json
+++ b/src/nodejs/unit-http/package.json
@@ -4,14 +4,15 @@
"description": "HTTP module for NGINX Unit",
"main": "http.js",
"files": [
+ "unit.h",
+ "version.h",
"addon.cpp",
- "binding.gyp",
- "http_server.js",
+ "unit.cpp",
"http.js",
+ "http_server.js",
"package.json",
"socket.js",
- "unit.cpp",
- "unit.h",
+ "binding.gyp",
"README.md"
],
"scripts": {
diff --git a/src/nodejs/unit-http/unit.h b/src/nodejs/unit-http/unit.h
index 5f541cc4..8baeb967 100644
--- a/src/nodejs/unit-http/unit.h
+++ b/src/nodejs/unit-http/unit.h
@@ -6,18 +6,23 @@
#ifndef _NXT_NODEJS_UNIT_H_INCLUDED_
#define _NXT_NODEJS_UNIT_H_INCLUDED_
-
#include <node_api.h>
-
#ifdef __cplusplus
extern "C" {
#endif
+#include "version.h"
#include <nxt_unit.h>
+
+#if NXT_UNIT_VERNUM != NXT_NODE_VERNUM
+#error "libunit version mismatch."
+#endif
+
#include <nxt_unit_response.h>
#include <nxt_unit_request.h>
+
#ifdef __cplusplus
} /* extern "C" */
#endif