[gnutls-devel] GnuTLS | C++ doc example does not compile if gnulib overrides the "write" function on mingw (#1480)

Read-only notification of GnuTLS library development activities gnutls-devel at lists.gnutls.org
Tue Apr 25 22:33:00 CEST 2023



Vivien Kraus Would Rather Not Be On Gitlab_com created an issue: https://gitlab.com/gnutls/gnutls/-/issues/1480



Hello,

Mingw does not have a "write" function, but it has a "_write" function. Gnulib is smart: it defines the "write" macro as "_write" on mingw. The only problem is, the C++ STL defines a method in std::ostream, named "write". Since "write" is a macro, now some C++ code somewhere is compiled as a call to std::ostream::_write, which does not exist.

The only solution I see is to use a C++ namespace for gnulib: https://www.gnu.org/software/gnulib/manual/html_node/A-C_002b_002b-namespace-for-gnulib.html

This is for doc/examples/ex-cxx.cpp

-- 
Reply to this email directly or view it on GitLab: https://gitlab.com/gnutls/gnutls/-/issues/1480
You're receiving this email because of your account on gitlab.com.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gnupg.org/pipermail/gnutls-devel/attachments/20230425/e1884076/attachment.html>


More information about the Gnutls-devel mailing list