Skip to content

Commit 0d3d190

Browse files
committed
src: add uvwasi version
1 parent 8d0c214 commit 0d3d190

File tree

3 files changed

+24
-2
lines changed

3 files changed

+24
-2
lines changed

src/node_metadata.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include "node.h"
77
#include "util.h"
88
#include "uv.h"
9+
#include "uvwasi.h"
910
#include "v8.h"
1011
#include "zlib.h"
1112

@@ -67,6 +68,14 @@ void Metadata::Versions::InitializeIntlVersions() {
6768
}
6869
#endif // NODE_HAVE_I18N_SUPPORT
6970

71+
// define the UVWASI_VERSION if UVWASI_VERSION_* exists
72+
#if defined(UVWASI_VERSION_MAJOR) && defined(UVWASI_VERSION_MINOR) && \
73+
defined(UVWASI_VERSION_PATCH)
74+
#define UVWASI_VERSION \
75+
STRINGIFY(UVWASI_VERSION_MAJOR) \
76+
"." STRINGIFY(UVWASI_VERSION_MINOR) "." STRINGIFY(UVWASI_VERSION_PATCH)
77+
#endif // UVWASI_VERSION_MAJOR UVWASI_VERSION_MINOR UVWASI_VERSION_PATCH
78+
7079
Metadata::Versions::Versions() {
7180
node = NODE_VERSION_STRING;
7281
v8 = v8::V8::GetVersion();
@@ -103,6 +112,10 @@ Metadata::Versions::Versions() {
103112
ngtcp2 = NGTCP2_VERSION;
104113
nghttp3 = NGHTTP3_VERSION;
105114
#endif
115+
116+
#ifdef UVWASI_VERSION
117+
uvwasi = UVWASI_VERSION;
118+
#endif // UVWASI_VERSION
106119
}
107120

108121
Metadata::Release::Release() : name(NODE_RELEASE) {

src/node_metadata.h

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,8 @@
1313
#endif
1414
#endif // HAVE_OPENSSL
1515

16+
#include "uvwasi.h"
17+
1618
namespace node {
1719

1820
// if this is a release build and no explicit base has been set
@@ -37,7 +39,12 @@ namespace node {
3739
V(modules) \
3840
V(nghttp2) \
3941
V(napi) \
40-
V(llhttp) \
42+
V(llhttp)
43+
44+
#if defined(UVWASI_VERSION_MAJOR) && defined(UVWASI_VERSION_MINOR) && \
45+
defined(UVWASI_VERSION_PATCH)
46+
#define NODE_VERSIONS_UVWASI(V) V(uvwasi)
47+
#endif // UVWASI_VERSION_PATCH UVWASI_VERSION_MINOR UVWASI_VERSION_MAJOR
4148

4249
#if HAVE_OPENSSL
4350
#define NODE_VERSIONS_KEY_CRYPTO(V) V(openssl)
@@ -67,7 +74,8 @@ namespace node {
6774
NODE_VERSIONS_KEYS_BASE(V) \
6875
NODE_VERSIONS_KEY_CRYPTO(V) \
6976
NODE_VERSIONS_KEY_INTL(V) \
70-
NODE_VERSIONS_KEY_QUIC(V)
77+
NODE_VERSIONS_KEY_QUIC(V) \
78+
NODE_VERSIONS_UVWASI(V)
7179

7280
class Metadata {
7381
public:

test/parallel/test-process-versions.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const expected_keys = [
1313
'nghttp2',
1414
'napi',
1515
'llhttp',
16+
'uvwasi',
1617
];
1718

1819
if (common.hasCrypto) {

0 commit comments

Comments
 (0)