From 44e7ecc8d2a2cc39aa5d02cc4c85ea23ce8f90a0 Mon Sep 17 00:00:00 2001 From: shenzhuxi Date: Mon, 28 Feb 2022 12:24:11 +0000 Subject: [PATCH] Made i2c-bus context-aware --- src/i2c.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/i2c.cc b/src/i2c.cc index b7196eb..2bd0156 100644 --- a/src/i2c.cc +++ b/src/i2c.cc @@ -89,7 +89,11 @@ NAN_MODULE_INIT(InitAll) { ExportInt(target, "I2C_FUNC_SMBUS_WRITE_I2C_BLOCK", I2C_FUNC_SMBUS_WRITE_I2C_BLOCK); } +#if NODE_MAJOR_VERSION >= 10 +NODE_MODULE_CONTEXT_AWARE(i2c, InitAll) +#else NODE_MODULE(i2c, InitAll) +#endif // Hack to speed up compilation. // Originally all the cc files included below were listed in the sources