The only reason compat.h is required in random.cpp for Windows (note the #ifdef WIN32), is for ssize_t and an “indirect” inclusion of windows.h. I say indirect, because windows.h isn’t actually included in compat.h either, it’s dragged in as a side-effect of other windows includes there, i.e winsock2.h.
Remove this coupling by replacing ssize_t with int, just including windows.h and removing compat.h.
DrahtBot
commented at 6:02 pm on January 4, 2023:
contributor
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.
Reviews
See the guideline for information on the review process.
If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.
maflcko added the label
DrahtBot Guix build requested
on Jan 5, 2023
maflcko renamed this:
random: remove windows-only compat.h usage
refactor: remove windows-only compat.h usage in random
on Jan 5, 2023
hebasto
commented at 11:29 am on January 5, 2023:
member
Concept ACK.
Remove this coupling by replacing ssize_t with int, just including windows.h and removing compat.h.
Why windows.h is required in here?
fanquake
commented at 11:31 am on January 5, 2023:
member
Why windows.h is required in here?
For the windows cryptography functions & types. You can’t use wincrypt.h without windows.h.
hebasto approved
hebasto
commented at 12:33 pm on January 5, 2023:
member
ACK4e7bed297a6dd1ae0da52a7eb99659849f18f259
As windows.h includes wincrypt.h, we can provide the NOCRYPT macro, along with WIN32_LEAN_AND_MEAN and NOMINMAX ones, to make other translation units, which #include <windows.h>, smaller.
nm, WIN32_LEAN_AND_MEAN implies NOCRYPT.
DrahtBot
commented at 6:57 pm on January 5, 2023:
contributor
DrahtBot removed the label
DrahtBot Guix build requested
on Jan 5, 2023
DrahtBot added the label
Refactoring
on Jan 5, 2023
maflcko referenced this in commit
5271c77f83
on Jan 23, 2023
sidhujag referenced this in commit
18c920073b
on Jan 23, 2023
random: use int for MAX_TRIES
Removing the use of ssize_t, removes the need to include compat.h, just
to make Windows happy.
4dc12816ac
random: remove compat.h include
We no-longer need ssize_t.
Add windows.h, which was being indirectly included via compat.h. It isn't
actually included in compat.h itself, but was being included as a side-effect
of other includes, like winsock2.h.
75ec6275e6
random: consolidate WIN32 #ifdefs
Order includes
Remove // for xyz comments
621cfb7722
fanquake force-pushed
on Feb 17, 2023
fanquake requested review from john-moffett
on Feb 17, 2023
fanquake requested review from hebasto
on Feb 17, 2023
hebasto approved
hebasto
commented at 4:30 pm on February 17, 2023:
member
re-ACK621cfb77227b5a240d66547947f73130f0c51f44, rebased only since my recent review. Verified with:
This is a metadata mirror of the GitHub repository
bitcoin/bitcoin.
This site is not affiliated with GitHub.
Content is generated from a GitHub metadata backup.
generated: 2026-02-17 06:13 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me