From 9947303a2dea39e5f64f102b9650137a32e02b81 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Sun, 23 Mar 2025 11:00:10 +0530 Subject: [PATCH 1/5] Update addon.c Signed-off-by: JaySoni1 --- lib/node_modules/@stdlib/math/base/special/signum/src/addon.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c index 66b636b04e6a..87a0d2138c7e 100644 --- a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c +++ b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c @@ -19,4 +19,5 @@ #include "stdlib/math/base/special/signum.h" #include "stdlib/math/base/napi/unary.h" -STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_signum ) +// Fix: Renamed the wrapper function to avoid shadowing +STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_signum_wrapper ) From 6557468cf403d06a15056497aec9d1aaf388e596 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Sun, 23 Mar 2025 11:13:31 +0530 Subject: [PATCH 2/5] Update addon.c Signed-off-by: JaySoni1 --- .../@stdlib/math/base/special/signum/src/addon.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c index 87a0d2138c7e..3ecbaa8cb7c1 100644 --- a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c +++ b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c @@ -19,5 +19,10 @@ #include "stdlib/math/base/special/signum.h" #include "stdlib/math/base/napi/unary.h" -// Fix: Renamed the wrapper function to avoid shadowing +// Define a wrapper function to avoid shadowing +static double stdlib_base_signum_wrapper( const double x ) { + return stdlib_base_signum( x ); +} + +// Use the wrapper function in the macro to prevent shadowing issues STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_signum_wrapper ) From fbf34992b2944e6d14c237d7cd4099a1b2298047 Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Sun, 23 Mar 2025 11:18:50 +0530 Subject: [PATCH 3/5] Update addon.c Signed-off-by: JaySoni1 --- .../@stdlib/math/base/special/signum/src/addon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c index 3ecbaa8cb7c1..c3d72ca97e86 100644 --- a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c +++ b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c @@ -19,10 +19,10 @@ #include "stdlib/math/base/special/signum.h" #include "stdlib/math/base/napi/unary.h" -// Define a wrapper function to avoid shadowing -static double stdlib_base_signum_wrapper( const double x ) { +// Define the callback function for the NAPI module +static double stdlib_base_signum_callback( const double x ) { return stdlib_base_signum( x ); } -// Use the wrapper function in the macro to prevent shadowing issues -STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_signum_wrapper ) +// Register the NAPI module, using a distinct symbol +STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_signum_callback ) From 9cbd3923e0034420f2dfc210e8168e909d62756e Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Sun, 23 Mar 2025 11:23:47 +0530 Subject: [PATCH 4/5] Update addon.c Signed-off-by: JaySoni1 --- .../@stdlib/math/base/special/signum/src/addon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c index c3d72ca97e86..1441469e010e 100644 --- a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c +++ b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c @@ -19,10 +19,10 @@ #include "stdlib/math/base/special/signum.h" #include "stdlib/math/base/napi/unary.h" -// Define the callback function for the NAPI module -static double stdlib_base_signum_callback( const double x ) { +// Wrapper function: avoid naming conflict +static double stdlib_base_signum_cb( const double x ) { return stdlib_base_signum( x ); } -// Register the NAPI module, using a distinct symbol -STDLIB_MATH_BASE_NAPI_MODULE_D_D( stdlib_base_signum_callback ) +// Register the module using a distinct symbol (different from the function name) +STDLIB_MATH_BASE_NAPI_MODULE_D_D( signum_module, stdlib_base_signum_cb ) From 6ad6b1612619f3701370f9841abf6b66b0c6efea Mon Sep 17 00:00:00 2001 From: JaySoni1 Date: Sun, 23 Mar 2025 11:34:49 +0530 Subject: [PATCH 5/5] Update addon.c Signed-off-by: JaySoni1 --- .../@stdlib/math/base/special/signum/src/addon.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c index 1441469e010e..eac7b0fb6e2b 100644 --- a/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c +++ b/lib/node_modules/@stdlib/math/base/special/signum/src/addon.c @@ -19,10 +19,10 @@ #include "stdlib/math/base/special/signum.h" #include "stdlib/math/base/napi/unary.h" -// Wrapper function: avoid naming conflict -static double stdlib_base_signum_cb( const double x ) { +// Wrapper function that calls the actual implementation +static double signum_callback( const double x ) { return stdlib_base_signum( x ); } -// Register the module using a distinct symbol (different from the function name) -STDLIB_MATH_BASE_NAPI_MODULE_D_D( signum_module, stdlib_base_signum_cb ) +// Export the wrapper with a unique symbol name to avoid shadowing +STDLIB_MATH_BASE_NAPI_MODULE_D_D( signum_module, signum_callback )