diff --git a/CHANGELOG.md b/CHANGELOG.md index 1bcaef4..eeceeaa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.0.4+4 + +* Added support for 32 bit architecture. + ## 0.0.4+3 * Fixed type casting issue between `Uint8List` and `Uint64List` while passing callback arguments from C side to Dart side. diff --git a/README.md b/README.md index 76786c7..75189dc 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ This is a [GSoC 2021 project](https://summerofcode.withgoogle.com/projects/#4757 ## Supported Platforms -Currently, 64 bit Android and Desktop Platforms (Linux, Windows and MacOS) are supported. +Currently, Android and Desktop Platforms (Linux, Windows and MacOS) are supported. ## Requirements diff --git a/pubspec.yaml b/pubspec.yaml index 668776e..4d0529b 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -3,7 +3,7 @@ # BSD-style license that can be found in the LICENSE file. name: cronet -version: 0.0.4+3 +version: 0.0.4+4 homepage: https://github.com/google/cronet.dart description: Experimental Cronet dart bindings. diff --git a/src/wrapper.cc b/src/wrapper.cc index 03a5b19..5bfddbf 100644 --- a/src/wrapper.cc +++ b/src/wrapper.cc @@ -9,6 +9,7 @@ #include "../third_party/dart-sdk/dart_tools_api.h" #include #include +#include #include #include @@ -127,8 +128,12 @@ Dart_CObject CallbackArgBuilder(int num, ...) { void *request_buffer = malloc(sizeof(uint64_t) * num); uint64_t *buf = reinterpret_cast(request_buffer); + // uintptr_r will get implicitly casted to uint64_t. So, when the code is + // executed in 32 bit mode, the upper 32 bit of buf[i] will be 0 extended + // automatically. This is required because, on the Dart side these addresses + // are viewed as 64 bit integers. for (int i = 0; i < num; i++) { - buf[i] = va_arg(valist, uint64_t); + buf[i] = va_arg(valist, uintptr_t); } c_request_data.type = Dart_CObject_kExternalTypedData;