From a2495bd1ac9e5e54074d65616de0efa822a6309e Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Wed, 1 Apr 2020 00:13:11 +0200 Subject: Add preliminary VisualStudio support - Mostly workarounds/clutches in compat.h - Change getline return type to int - Replace C99 style flexible array with alloca - Add all the MSVC solution/project crap Signed-off-by: David Oberhollenzer --- lib/sqfs/comp/compressor.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib/sqfs/comp/compressor.c') diff --git a/lib/sqfs/comp/compressor.c b/lib/sqfs/comp/compressor.c index 946ee25..2294b98 100644 --- a/lib/sqfs/comp/compressor.c +++ b/lib/sqfs/comp/compressor.c @@ -42,7 +42,7 @@ static const char *names[] = { int sqfs_generic_write_options(sqfs_file_t *file, const void *data, size_t size) { - sqfs_u8 buffer[size + 2]; + sqfs_u8 *buffer = alloca(size + 2); int ret; *((sqfs_u16 *)buffer) = htole16(0x8000 | size); @@ -58,7 +58,7 @@ int sqfs_generic_write_options(sqfs_file_t *file, const void *data, size_t size) int sqfs_generic_read_options(sqfs_file_t *file, void *data, size_t size) { - sqfs_u8 buffer[size + 2]; + sqfs_u8 *buffer = alloca(size + 2); int ret; ret = file->read_at(file, sizeof(sqfs_super_t), -- cgit v1.2.3