madler / unzip

Fork of InfoZIP UnZip 6.0 for new zip bomb detection patch
Other
32 stars 16 forks source link

Build with vc142 #7

Open ncook-hxgn opened 3 years ago

ncook-hxgn commented 3 years ago

Hi there,

After digging around, I found windll\vc8\Unzip32.sln, but it won't build with Visual Studio 2019 16.7.3 or MSBuild 16.7 .. any chance of a vc142 solution? (Or maybe I didn't find it yet?)

E:\repos\NuGet\unzip>msbuild windll\vc8\unzip32.sln
Microsoft (R) Build Engine version 16.7.0+b89cb5fde for .NET Framework
Copyright (C) Microsoft Corporation. All rights reserved.

Building the projects in this solution one at a time. To enable parallel build, please add the "-m" switch.
Build started 14/01/2021 15:40:04.
MSBUILD : error MSB4025: The project file could not be loaded. Root element is missing.

Build FAILED.

  MSBUILD : error MSB4025: The project file could not be loaded. Root element is missing.

    0 Warning(s)
    1 Error(s)

Time Elapsed 00:00:00.02

E:\repos\NuGet\unzip>

If it's as simple as copying windll\vc8 to windll\vc142, and performing the upgrade, I'm willing to create a PR.

E:\repos\NuGet\unzip>devenv windll\vc8\unzip32.sln

image

ncook-hxgn commented 3 years ago

On doing a fairly mindless copy/paste/upgrade, I get the following errors when building the Static Release|Win32 config of unzip32.sln with Visual Studio 2019 16.7.3:

2>E:\repos\NuGet\unzip\extract.c(2182,36): error C2198: 'readbuf': too few arguments for call
2>E:\repos\NuGet\unzip\win32\win32.c(195,18): error C2373: '__p__pgmptr': redefinition; different type modifiers
2>C:\Program Files (x86)\Windows Kits\10\Include\10.0.19041.0\ucrt\stdlib.h(242): message : see declaration of '__p__pgmptr'

There are also a few warnings:

2>E:\repos\NuGet\unzip\extract.c(2195,50): warning C4133: 'function': incompatible types - from 'char *' to 'Uz_Globs *'
2>E:\repos\NuGet\unzip\extract.c(2195,53): warning C4047: 'function': 'char *' differs in levels of indirection from 'int'
2>E:\repos\NuGet\unzip\extract.c(2195,52): warning C4024: 'readbuf': different types for formal and actual parameter 2
2>E:\repos\NuGet\unzip\win32\win32.c(497,13): warning C4996: 'GetVersion': was declared deprecated

The final result:

Projects build report:
  Status    | Project [Config|platform]
 -----------|---------------------------------------------------------------------------------------------------
  Failed    | sfx\unzsfx32.vcxproj [Release|Win32]
  Failed    | dll\unz32dll.vcxproj [Static Release|Win32]

Possibly I will leave this the experts..