Skip to content

Commit 070e8aa

Browse files
committed
Merge branch 'master' of github.com:mdh34/quickDocs
2 parents 46c4bc9 + 0e8bfd9 commit 070e8aa

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

src/Services/Downloader.vala

+11-2
Original file line numberDiff line numberDiff line change
@@ -41,15 +41,24 @@ namespace Downloader {
4141
continue;
4242
};
4343

44-
void* buffer = null;
45-
size_t buffer_length;
4644
Posix.off_t offset;
4745

46+
#if ARCHIVE_332
47+
uint8[] buffer;
48+
if (entry.size () > 0) {
49+
while (reader.read_data_block (out buffer, out offset) != Archive.Result.EOF) {
50+
disk.write_data_block (buffer, offset);
51+
}
52+
}
53+
#else
54+
void* buffer = null;
55+
size_t buffer_length;
4856
if (entry.size () > 0) {
4957
while (reader.read_data_block (out buffer, out buffer_length, out offset) != Archive.Result.EOF) {
5058
disk.write_data_block (buffer, buffer_length, offset);
5159
}
5260
}
61+
#endif
5362
}
5463
}
5564

src/meson.build

+3
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
if dependency('libarchive').version().version_compare('>=3.3.2')
2+
add_project_arguments('--define=ARCHIVE_332', language: 'vala')
3+
endif
14
executable(
25
meson.project_name(),
36
'Application.vala',

0 commit comments

Comments
 (0)