Skip to content

Changes to allow compilation using MSVC 2010#5

Merged
vkrasnov merged 3 commits intocloudflare:gcc.amd64from
BarryLevinson:gcc.amd64
Feb 27, 2017
Merged

Changes to allow compilation using MSVC 2010#5
vkrasnov merged 3 commits intocloudflare:gcc.amd64from
BarryLevinson:gcc.amd64

Conversation

@BarryLevinson
Copy link
Copy Markdown

ZLib can be compiled with Microsoft Visual Studio 2010, but there are a few minor changes in cloudflare's fork that prevent compilation. This pull request moves around some variable declarations to top of block to allow C89 compatibility. It also ifdef's in definitions for likely/unlikely and _builtin_ctzl if _MSC_VER is set.

Please let me know if these changes look ok, or if you think I should make any changes to them. I'd love to have the ability to use MSVC pulled back into your branch.

Thanks,

--Barry

Barry Levinson added 3 commits February 27, 2017 13:45
1) MSVC doesn't have __builtin_expect.  Just ignore
   likely/unlikely and hope the compiler optimizes for the best.
2) MSVC also doesn't have __builtin_ctzl.  Implement using
   _BitScanForward().
-MSVC (2010) only supports C89 for c files.  All variable
 declarations need to be moved to the top of blocks.
-MSVC also doesn't support GCC's typeof.  No real need to call it
 in deflate.c anyway, so I removed it.
@vkrasnov vkrasnov merged commit 836eb11 into cloudflare:gcc.amd64 Feb 27, 2017
fhanau pushed a commit to fhanau/zlib that referenced this pull request Feb 27, 2023
Fix typo in spec: QuicTransportBase -> QuicTransport
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants