From eaaf9b8bc190bbaf2a59df046b68db22effd3a33 Mon Sep 17 00:00:00 2001 From: Nick Harrison <42382362+nickpharrison@users.noreply.github.com> Date: Tue, 19 Jan 2021 10:51:44 +0800 Subject: [PATCH 1/2] Switch to using global namespace-defined toupper std::toupper is not defined, so use global version instead --- src/Util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Util.h b/src/Util.h index 8f935359d..a6b841822 100644 --- a/src/Util.h +++ b/src/Util.h @@ -28,6 +28,6 @@ inline void SetProtoAccessor( inline bool streq_casein(std::string& str1, std::string& str2) { return str1.size() == str2.size() && std::equal(str1.begin(), str1.end(), str2.begin(), [](char& c1, char& c2) { - return c1 == c2 || std::toupper(c1) == std::toupper(c2); + return c1 == c2 || ::toupper(c1) == ::toupper(c2); }); } From acab42bc72766a7729beb498bdc4b0bb50354bf2 Mon Sep 17 00:00:00 2001 From: Nick Harrison <42382362+nickpharrison@users.noreply.github.com> Date: Tue, 19 Jan 2021 10:53:49 +0800 Subject: [PATCH 2/2] Change to a context-aware module --- src/init.cc | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/init.cc b/src/init.cc index 816ba5837..e4ff0653f 100644 --- a/src/init.cc +++ b/src/init.cc @@ -89,4 +89,8 @@ NAN_MODULE_INIT(init) { Nan::Set(target, Nan::New("freetypeVersion").ToLocalChecked(), Nan::New(freetype_version).ToLocalChecked()).Check(); } -NODE_MODULE(canvas, init); +// Switch to using a context-aware module +//NODE_MODULE(canvas, init); +NODE_MODULE_INIT() { + init(exports); +}