From a442db2c24fda7a7108f281369b829d19bbf811a Mon Sep 17 00:00:00 2001 From: Jia Hao Date: Tue, 26 Nov 2024 00:47:19 +0800 Subject: [PATCH] Add missing import for malloc (flutter/engine#56781) Internal bug: b/380745221 The use of `malloc` in L70: https://github.com/flutter/engine/blob/d48ceb1ba2c27c860a9cca30ce8a8d4dae2348f1/third_party/tonic/filesystem/filesystem/file.cc#L70 Results in the following error, after an update to the internal toolchain. For some reason, this error only appears when targeting Linux. ``` tonic/filesystem/filesystem/file.cc:70:28: error: use of undeclared identifier 'malloc' 70 | uint8_t* ptr = (uint8_t*)malloc(file_size); | ^ 1 error generated. ``` This PR fixes it by including the header file. [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../src/flutter/third_party/tonic/filesystem/filesystem/file.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/engine/src/flutter/third_party/tonic/filesystem/filesystem/file.cc b/engine/src/flutter/third_party/tonic/filesystem/filesystem/file.cc index c8436c8905..29bd77fd37 100644 --- a/engine/src/flutter/third_party/tonic/filesystem/filesystem/file.cc +++ b/engine/src/flutter/third_party/tonic/filesystem/filesystem/file.cc @@ -5,6 +5,7 @@ #include "tonic/filesystem/filesystem/file.h" #include +#include #include #include