freebsd: hard-code UV_ENODATA definition (#3999)

`FreeBSD` defines `ENODATA` in /usr/include/c++/v1/errno.h which is only visible
if C++ is the compilation unit. This can cause interop issues when
integrating libuv build with C on a C++ project. Avoid this issue by
directly defining with the value defined in the file previously
mentioned.
This commit is contained in:
Santiago Gimeno 2023-05-16 20:43:30 +02:00 committed by GitHub
parent d1a2efc77b
commit 6f94701467
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -456,8 +456,14 @@
# define UV__ESOCKTNOSUPPORT (-4025)
#endif
/* FreeBSD defines ENODATA in /usr/include/c++/v1/errno.h which is only visible
* if C++ is being used. Define it directly to avoid problems when integrating
* libuv in a C++ project.
*/
#if defined(ENODATA) && !defined(_WIN32)
# define UV__ENODATA UV__ERR(ENODATA)
#elif defined(__FreeBSD__)
# define UV__ENODATA (-9919)
#else
# define UV__ENODATA (-4024)
#endif