koffi 2.3.15 → 2.3.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +11 -0
- package/build/2.3.16/koffi_darwin_arm64/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_darwin_x64/koffi.node +0 -0
- package/build/2.3.16/koffi_freebsd_arm64/koffi.node +0 -0
- package/build/2.3.16/koffi_freebsd_ia32/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_freebsd_x64/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_linux_arm32hf/koffi.node +0 -0
- package/build/2.3.16/koffi_linux_arm64/koffi.node +0 -0
- package/build/2.3.16/koffi_linux_ia32/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_linux_riscv64hf64/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_linux_x64/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_openbsd_ia32/koffi.node +0 -0
- package/build/2.3.16/koffi_openbsd_x64/koffi.node +0 -0
- package/build/2.3.16/koffi_win32_arm64/koffi.exp +0 -0
- package/build/2.3.16/koffi_win32_arm64/koffi.lib +0 -0
- package/build/2.3.16/koffi_win32_arm64/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_win32_ia32/koffi.exp +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_win32_ia32/koffi.lib +0 -0
- package/build/2.3.16/koffi_win32_ia32/koffi.node +0 -0
- package/build/{2.3.15 → 2.3.16}/koffi_win32_x64/koffi.exp +0 -0
- package/build/{2.3.15/koffi_win32_arm64 → 2.3.16/koffi_win32_x64}/koffi.lib +0 -0
- package/build/2.3.16/koffi_win32_x64/koffi.node +0 -0
- package/package.json +2 -2
- package/src/cnoke/cnoke.js +1 -1
- package/src/cnoke/package.json +1 -1
- package/src/cnoke/src/builder.js +2 -2
- package/src/koffi/CMakeLists.txt +4 -0
- package/src/koffi/src/ffi.cc +19 -14
- package/build/2.3.15/koffi_darwin_arm64/koffi.node +0 -0
- package/build/2.3.15/koffi_freebsd_arm64/koffi.node +0 -0
- package/build/2.3.15/koffi_freebsd_ia32/koffi.node +0 -0
- package/build/2.3.15/koffi_linux_arm64/koffi.node +0 -0
- package/build/2.3.15/koffi_linux_ia32/koffi.node +0 -0
- package/build/2.3.15/koffi_openbsd_x64/koffi.node +0 -0
- package/build/2.3.15/koffi_win32_arm64/koffi.exp +0 -0
- package/build/2.3.15/koffi_win32_arm64/koffi.node +0 -0
- package/build/2.3.15/koffi_win32_ia32/koffi.node +0 -0
- package/build/2.3.15/koffi_win32_x64/koffi.lib +0 -0
- package/build/2.3.15/koffi_win32_x64/koffi.node +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -4,6 +4,17 @@
|
|
|
4
4
|
|
|
5
5
|
### Koffi 2.3
|
|
6
6
|
|
|
7
|
+
#### Koffi 2.3.16
|
|
8
|
+
|
|
9
|
+
**Main changes:**
|
|
10
|
+
|
|
11
|
+
- Fix Windows ARM64 build to work with official Node.js version
|
|
12
|
+
- Compile Windows builds with Visual Studio 2022 17.5.3
|
|
13
|
+
|
|
14
|
+
**Other changes:**
|
|
15
|
+
|
|
16
|
+
- Support null in koffi.free() and koffi.address()
|
|
17
|
+
|
|
7
18
|
#### Koffi 2.3.15
|
|
8
19
|
|
|
9
20
|
**Main changes:**
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
package/package.json
CHANGED
package/src/cnoke/cnoke.js
CHANGED
|
@@ -155,7 +155,7 @@ Options:
|
|
|
155
155
|
(default: ${cnoke.DefaultOptions.mode})
|
|
156
156
|
-D, --debug Shortcut for --config Debug
|
|
157
157
|
|
|
158
|
-
--prebuild Use prebuilt
|
|
158
|
+
--prebuild Use prebuilt binary if available
|
|
159
159
|
|
|
160
160
|
-a, --arch <ARCH> Change architecture and ABI
|
|
161
161
|
(default: ${cnoke.determine_arch()})
|
package/src/cnoke/package.json
CHANGED
package/src/cnoke/src/builder.js
CHANGED
|
@@ -103,7 +103,7 @@ function Builder(config = {}) {
|
|
|
103
103
|
let basename = `node-v${runtime_version}-headers.tar.gz`;
|
|
104
104
|
let urls = [
|
|
105
105
|
`https://nodejs.org/dist/v${runtime_version}/${basename}`,
|
|
106
|
-
`https://unofficial-builds.nodejs.org/download/release/v${runtime_version}/${basename}`
|
|
106
|
+
// `https://unofficial-builds.nodejs.org/download/release/v${runtime_version}/${basename}`
|
|
107
107
|
];
|
|
108
108
|
let destname = `${cache_dir}/${basename}`;
|
|
109
109
|
|
|
@@ -130,7 +130,7 @@ function Builder(config = {}) {
|
|
|
130
130
|
if (!fs.existsSync(destname)) {
|
|
131
131
|
let urls = [
|
|
132
132
|
`https://nodejs.org/dist/v${runtime_version}/${dirname}/node.lib`,
|
|
133
|
-
`https://unofficial-builds.nodejs.org/download/release/v${runtime_version}/${dirname}/node.lib`
|
|
133
|
+
// `https://unofficial-builds.nodejs.org/download/release/v${runtime_version}/${dirname}/node.lib`
|
|
134
134
|
];
|
|
135
135
|
await tools.download_http(urls, destname);
|
|
136
136
|
}
|
package/src/koffi/CMakeLists.txt
CHANGED
|
@@ -20,6 +20,8 @@
|
|
|
20
20
|
# OTHER DEALINGS IN THE SOFTWARE.
|
|
21
21
|
|
|
22
22
|
cmake_minimum_required(VERSION 3.6)
|
|
23
|
+
cmake_policy(SET CMP0091 NEW)
|
|
24
|
+
|
|
23
25
|
project(koffi C CXX ASM)
|
|
24
26
|
|
|
25
27
|
include(CheckCXXCompilerFlag)
|
|
@@ -58,6 +60,8 @@ if(CMAKE_SIZEOF_VOID_P EQUAL 8)
|
|
|
58
60
|
# CMAKE_SYSTEM_PROCESSOR is wrong on Windows ARM64
|
|
59
61
|
|
|
60
62
|
if(CMAKE_SYSTEM_PROCESSOR MATCHES "aarch|arm" OR CMAKE_GENERATOR_PLATFORM STREQUAL "ARM64" OR CMAKE_OSX_ARCHITECTURES MATCHES "arm")
|
|
63
|
+
set(CMAKE_MSVC_RUNTIME_LIBRARY MultiThreaded)
|
|
64
|
+
|
|
61
65
|
if(WIN32)
|
|
62
66
|
get_filename_component(cl_dir "${CMAKE_CXX_COMPILER}" DIRECTORY)
|
|
63
67
|
file(TO_CMAKE_PATH "${cl_dir}/armasm64.exe" asm_compiler)
|
package/src/koffi/src/ffi.cc
CHANGED
|
@@ -723,18 +723,25 @@ static Napi::Value CreateDisposableType(const Napi::CallbackInfo &info)
|
|
|
723
723
|
return WrapType(env, instance, type);
|
|
724
724
|
}
|
|
725
725
|
|
|
726
|
-
static inline bool
|
|
726
|
+
static inline bool GetExternalPointer(Napi::Env env, Napi::Value value, void **out_ptr)
|
|
727
727
|
{
|
|
728
728
|
InstanceData *instance = env.GetInstanceData<InstanceData>();
|
|
729
729
|
|
|
730
|
-
if (
|
|
731
|
-
|
|
732
|
-
|
|
730
|
+
if (IsNullOrUndefined(value)) {
|
|
731
|
+
*out_ptr = 0;
|
|
732
|
+
return true;
|
|
733
|
+
} else if (value.IsExternal() && !CheckValueTag(instance, value, &TypeInfoMarker) &&
|
|
734
|
+
!CheckValueTag(instance, value, &CastMarker) &&
|
|
735
|
+
!CheckValueTag(instance, value, &MagicUnionMarker)) {
|
|
736
|
+
Napi::External<void> external = value.As<Napi::External<void>>();
|
|
737
|
+
void *ptr = external.Data();
|
|
738
|
+
|
|
739
|
+
*out_ptr = ptr;
|
|
740
|
+
return true;
|
|
741
|
+
} else {
|
|
733
742
|
ThrowError<Napi::TypeError>(env, "Unexpected %1 value for ptr, expected external pointer", GetValueType(instance, value));
|
|
734
743
|
return false;
|
|
735
744
|
}
|
|
736
|
-
|
|
737
|
-
return true;
|
|
738
745
|
}
|
|
739
746
|
|
|
740
747
|
static Napi::Value CallFree(const Napi::CallbackInfo &info)
|
|
@@ -745,11 +752,10 @@ static Napi::Value CallFree(const Napi::CallbackInfo &info)
|
|
|
745
752
|
ThrowError<Napi::TypeError>(env, "Expected 1 argument, got %1", info.Length());
|
|
746
753
|
return env.Null();
|
|
747
754
|
}
|
|
748
|
-
if (!CheckExternalPointer(env, info[0]))
|
|
749
|
-
return env.Null();
|
|
750
755
|
|
|
751
|
-
|
|
752
|
-
|
|
756
|
+
void *ptr = nullptr;
|
|
757
|
+
if (!GetExternalPointer(env, info[0], &ptr))
|
|
758
|
+
return env.Null();
|
|
753
759
|
|
|
754
760
|
free(ptr);
|
|
755
761
|
|
|
@@ -2030,11 +2036,10 @@ static Napi::Value GetPointerAddress(const Napi::CallbackInfo &info)
|
|
|
2030
2036
|
ThrowError<Napi::TypeError>(env, "Expected 1 argument, got %1", info.Length());
|
|
2031
2037
|
return env.Null();
|
|
2032
2038
|
}
|
|
2033
|
-
if (!CheckExternalPointer(env, info[0]))
|
|
2034
|
-
return env.Null();
|
|
2035
2039
|
|
|
2036
|
-
|
|
2037
|
-
|
|
2040
|
+
void *ptr = nullptr;
|
|
2041
|
+
if (!GetExternalPointer(env, info[0], &ptr))
|
|
2042
|
+
return env.Null();
|
|
2038
2043
|
|
|
2039
2044
|
uint64_t ptr64 = (uint64_t)(uintptr_t)ptr;
|
|
2040
2045
|
Napi::BigInt bigint = Napi::BigInt::New(env, ptr64);
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|