Re: [PATCH] [W32] Use SSIZE_T for ssize_t on Windows instead of long
John Thacker via Gcrypt-devel <[email protected]> Wed, 20 May 2026 07:12:13 -0400
| Newsgroups | gmane.comp.encryption.gpg.libgcrypt.devel |
|---|---|
| Message-ID | <CAP_QLgovf4xrG=TYr0fjcgcOah_f0MgNWr_1m8bxk6VRFv9B8Q@mail.gmail.com> |
--===============4865808742999996796== Content-Type: multipart/alternative; boundary="000000000000c65cf006523dde9a" --000000000000c65cf006523dde9a Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, May 20, 2026, 4:18=E2=80=AFAM Werner Koch <[email protected]> wrote: > Hi! > > I general we do not support building with MSVC but as one can see we > tried to help here. Technically your patch is an ABI change when not > using gcc or clang (which for often critized reason also defines > __GNUC__) but assuming that building with MSVC on WIN64 anyway gives a > lot of warning, we could claim that this ABI change is a bug fix. > Yes, Microsoft's vcpkg tool doesn't build libgcrypt with MSVC: https://github.com/microsoft/vcpkg/blob/e5a4f54c0d562059e9ccc6f7e7150667da5= 8fe41/ports/libgcrypt/vcpkg.json#L4 But does have packages from a fork made to help building with MSVC: https://github.com/microsoft/vcpkg/blob/e5a4f54c0d562059e9ccc6f7e7150667da5= 8fe41/ports/shiftmedia-libgcrypt/vcpkg.json That project looks like it's on hiatus, but it made the same sort of change to ssize_t. https://github.com/ShiftMediaProject/libgcrypt It looks like currently the only place ssize_t is currently used is in jitterentropy, in jent_read_entropy[_safe], so probably the largest impact of the define is that it's in the gcrypt.h header and affects other projects that include gcrypt.h and also define ssize_t for Windows for their own use, like Wireshark. Thanks again, John > --000000000000c65cf006523dde9a Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div dir=3D"auto"><div>On Wed, May 20, 2026, 4:18=E2=80=AF= AM Werner Koch <<a href=3D"mailto:[email protected]" target=3D"_blank">wk@gnu= pg.org</a>> wrote:<div class=3D"gmail_quote"><blockquote class=3D"gmail_= quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1= ex">Hi!<br><br> I general we do not support building with MSVC but as one can see we<br> tried to help here.=C2=A0 Technically your patch is an ABI change when not<= br> using gcc or clang (which for often critized reason also defines<br> __GNUC__) but assuming that building with MSVC on WIN64 anyway gives a<br> lot of warning, we could claim that this ABI change is a bug fix.<br></bloc= kquote></div></div><div dir=3D"auto"><br></div><div dir=3D"auto"><div style= =3D"font-family:arial,sans-serif" class=3D"gmail_default">Yes, Microsoft= 9;s vcpkg tool doesn't build libgcrypt with MSVC:</div><div style=3D"fo= nt-family:arial,sans-serif" class=3D"gmail_default"><a href=3D"https://gith= ub.com/microsoft/vcpkg/blob/e5a4f54c0d562059e9ccc6f7e7150667da58fe41/ports/= libgcrypt/vcpkg.json#L4">https://github.com/microsoft/vcpkg/blob/e5a4f54c0d= 562059e9ccc6f7e7150667da58fe41/ports/libgcrypt/vcpkg.json#L4</a></div><div = style=3D"font-family:arial,sans-serif" class=3D"gmail_default"><br></div><d= iv style=3D"font-family:arial,sans-serif" class=3D"gmail_default">But does = have packages from a fork made to help building with MSVC:</div><div style= =3D"font-family:arial,sans-serif" class=3D"gmail_default"><a href=3D"https:= //github.com/microsoft/vcpkg/blob/e5a4f54c0d562059e9ccc6f7e7150667da58fe41/= ports/shiftmedia-libgcrypt/vcpkg.json">https://github.com/microsoft/vcpkg/b= lob/e5a4f54c0d562059e9ccc6f7e7150667da58fe41/ports/shiftmedia-libgcrypt/vcp= kg.json</a></div><br></div><div dir=3D"auto"><div style=3D"font-family:aria= l,sans-serif" class=3D"gmail_default">That project looks like it's on h= iatus, but it made the same sort of change to ssize_t.</div><div style=3D"f= ont-family:arial,sans-serif" class=3D"gmail_default"><a href=3D"https://git= hub.com/ShiftMediaProject/libgcrypt">https://github.com/ShiftMediaProject/l= ibgcrypt</a></div><br></div><div dir=3D"auto">It looks like currently the o= nly place ssize_t=C2=A0<span class=3D"gmail_default" style=3D"font-family:a= rial,sans-serif">is currently used is in=C2=A0</span>jitt<span class=3D"gma= il_default" style=3D"font-family:arial,sans-serif">erentropy, in=C2=A0</spa= n>jent_read_entropy<span class=3D"gmail_default" style=3D"font-family:arial= ,sans-serif">[_safe], so probably the largest impact of the define is that = it's in the gcrypt.h header and affects other projects that include gcr= ypt.h and also define ssize_t for Windows for their own use, like Wireshark= .</span></div><div dir=3D"auto"><span class=3D"gmail_default" style=3D"font= -family:arial,sans-serif"><br></span></div><div><span class=3D"gmail_defaul= t" style=3D"font-family:arial,sans-serif">Thanks again,</span></div><div><s= pan class=3D"gmail_default" style=3D"font-family:arial,sans-serif">John</sp= an></div><div dir=3D"auto"><div class=3D"gmail_quote"><blockquote class=3D"= gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-= left:1ex"> </blockquote></div></div></div> </div> --000000000000c65cf006523dde9a-- --===============4865808742999996796== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Gcrypt-devel mailing list [email protected] https://lists.gnupg.org/mailman/listinfo/gcrypt-devel --===============4865808742999996796==--