Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[javascript][v8] Support for swig 4.1.0 #703

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Support for swig 4.1.0
In swig 4.1.0, the complicated handling of "SWIG_V8_VERSION" has been cleaned up a bit. I made the same changes as in this swig.

Signed-off-by: Hirokazu MORIKAWA <[email protected]>
nxhack committed May 8, 2021
commit c7d7718c21828883a4d8eea585b89185a1eaf150
4 changes: 3 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -272,7 +272,9 @@ if (CMAKE_VERSION VERSION_LESS "3.1")
endif()
else()
# 3.1+ uses this generic method to enable c++11
set (CMAKE_CXX_STANDARD 11)
if(NOT "${CMAKE_CXX_STANDARD}")
set (CMAKE_CXX_STANDARD 11)
endif ()
set (CXX_STANDARD_REQUIRED ON)
set (CXX_EXTENSIONS OFF)
endif()
4 changes: 4 additions & 0 deletions src/carrays_uint32_t.i
Original file line number Diff line number Diff line change
@@ -24,7 +24,11 @@
%typemap(in) uint32_t {
int ecode2 = 0 ;
if (($input)->IsInt32())
%#if (V8_MAJOR_VERSION-0) < 7
$1 = ($input)->Uint32Value();
%#else
$1 = ($input)->Uint32Value(SWIGV8_CURRENT_CONTEXT()).FromJust();
%#endif
else
SWIG_exception_fail(SWIG_ArgError(ecode2), "failed to convert uint32");
}
2 changes: 1 addition & 1 deletion src/common_top.i
Original file line number Diff line number Diff line change
@@ -27,7 +27,7 @@ void cleanUp()
/* Call the v8 garbage collector as long as there is memory to clean up
* See https://codereview.chromium.org/412163003 for this API change
*/
#if (SWIG_V8_VERSION < 0x032838)
#if (V8_MAJOR_VERSION-0) < 4 && (SWIG_V8_VERSION < 0x032838)
while (!v8::V8::IdleNotificationDeadline())
#else
while (!v8::Isolate::GetCurrent()->IdleNotificationDeadline(1000))