summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2023-06-16 10:24:37 +0200
committerRémi Verschelde <rverschelde@gmail.com>2023-06-16 10:24:37 +0200
commit598378513b256e69e9b824c36136774c41cc763c (patch)
tree58ae2448f76703d04b405312bd650d2975e4b4d0
parentada10b57f3b7f4afb280622044df0573637a8e39 (diff)
parentc7f4e3fd25ab06a80fa26a3ef030178c1ef425c4 (diff)
downloadredot-engine-598378513b256e69e9b824c36136774c41cc763c.tar.gz
Merge pull request #78319 from bruvzg/fix_lipo_fa
[macOS export] Fix lipo file handling.
-rw-r--r--platform/macos/export/lipo.cpp30
1 files changed, 16 insertions, 14 deletions
diff --git a/platform/macos/export/lipo.cpp b/platform/macos/export/lipo.cpp
index 15b369a8ed..2d77e5960d 100644
--- a/platform/macos/export/lipo.cpp
+++ b/platform/macos/export/lipo.cpp
@@ -45,25 +45,27 @@ bool LipO::create_file(const String &p_output_path, const PackedStringArray &p_f
uint64_t max_size = 0;
for (int i = 0; i < p_files.size(); i++) {
- MachO mh;
- if (!mh.open_file(p_files[i])) {
- ERR_FAIL_V_MSG(false, vformat("LipO: Invalid MachO file: \"%s.\"", p_files[i]));
- }
+ {
+ MachO mh;
+ if (!mh.open_file(p_files[i])) {
+ ERR_FAIL_V_MSG(false, vformat("LipO: Invalid MachO file: \"%s\".", p_files[i]));
+ }
- FatArch arch;
- arch.cputype = mh.get_cputype();
- arch.cpusubtype = mh.get_cpusubtype();
- arch.offset = 0;
- arch.size = mh.get_size();
- arch.align = mh.get_align();
- max_size += arch.size;
+ FatArch arch;
+ arch.cputype = mh.get_cputype();
+ arch.cpusubtype = mh.get_cpusubtype();
+ arch.offset = 0;
+ arch.size = mh.get_size();
+ arch.align = mh.get_align();
+ max_size += arch.size;
- archs.push_back(arch);
+ archs.push_back(arch);
+ }
Ref<FileAccess> fb = FileAccess::open(p_files[i], FileAccess::READ);
if (fb.is_null()) {
close();
- ERR_FAIL_V_MSG(false, vformat("LipO: Can't open file: \"%s.\"", p_files[i]));
+ ERR_FAIL_V_MSG(false, vformat("LipO: Can't open file: \"%s\".", p_files[i]));
}
}
@@ -100,7 +102,7 @@ bool LipO::create_file(const String &p_output_path, const PackedStringArray &p_f
Ref<FileAccess> fb = FileAccess::open(p_files[i], FileAccess::READ);
if (fb.is_null()) {
close();
- ERR_FAIL_V_MSG(false, vformat("LipO: Can't open file: \"%s.\"", p_files[i]));
+ ERR_FAIL_V_MSG(false, vformat("LipO: Can't open file: \"%s\".", p_files[i]));
}
uint64_t cur = fa->get_position();
for (uint64_t j = cur; j < archs[i].offset; j++) {