electron/patches/node/fix_remove_deprecated_errno_constants.patch
electron-roller[bot] b3d52c01e8
chore: bump node to v20.16.0 (main) (#43029)
* chore: bump node in DEPS to v20.16.0

* test: skip unstable shadow realm gc tests

https://github.com/nodejs/node/pull/52855

* test: extend env for `test-node-output-errors`

https://github.com/nodejs/node/pull/53535

* src: fix typo in env.cc

https://github.com/nodejs/node/pull/53418

* src: reset `process.versions` during pre-execution

https://github.com/nodejs/node/pull/53444

* chore: fixup patch indices

* src,permission: --allow-wasi & prevent WASI exec

https://github.com/nodejs/node/pull/53124

* tls: use SSL_get_peer_tmp_key

https://github.com/nodejs/node/pull/53366

* deps: update c-ares to 1.29.0

https://github.com/nodejs/node/pull/53155

* src: account for OpenSSL unexpected version

* crypto: fix propagation of "memory limit exceeded"

https://github.com/nodejs/node/pull/53300

* process: add process.getBuiltinModule(id)

https://github.com/nodejs/node/pull/52762

* windows 32bit: config change callback needs to be stdcall

8f265c9d51

* fix: building with UNICODE

https://github.com/c-ares/c-ares/pull/802

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
Co-authored-by: Keeley Hammond <khammond@slack-corp.com>
2024-07-26 12:52:05 -04:00

128 lines
3.8 KiB
Diff

From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Calvin Watford <cwatford@slack-corp.com>
Date: Thu, 28 Mar 2024 14:28:19 -0600
Subject: fix: remove deprecated errno constants
Various errno constants were deprecated by POSIX. libc++ added deprecation markers on these constants.
This change removes the usage of these constants to fix a compilation failure due to mappings of those constants. This patch should be upstreamed to node/libuv.
See: https://github.com/llvm/llvm-project/pull/80542
diff --git a/deps/uv/include/uv.h b/deps/uv/include/uv.h
index 3375600023e39ddacf62cc17deb4f206db942084..cc106422dd36aa0564e74dd8a16eec496433d3bd 100644
--- a/deps/uv/include/uv.h
+++ b/deps/uv/include/uv.h
@@ -155,7 +155,6 @@ struct uv__queue {
XX(EFTYPE, "inappropriate file type or format") \
XX(EILSEQ, "illegal byte sequence") \
XX(ESOCKTNOSUPPORT, "socket type not supported") \
- XX(ENODATA, "no data available") \
XX(EUNATCH, "protocol driver not attached") \
#define UV_HANDLE_TYPE_MAP(XX) \
diff --git a/deps/uv/include/uv/errno.h b/deps/uv/include/uv/errno.h
index 127278ef916161a96e23e645927d16bedfdaca5b..b36da3daa5744e6f994e32d9d82aaef689008a5f 100644
--- a/deps/uv/include/uv/errno.h
+++ b/deps/uv/include/uv/errno.h
@@ -456,18 +456,6 @@
# 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
-
#if defined(EUNATCH) && !defined(_WIN32)
# define UV__EUNATCH UV__ERR(EUNATCH)
#else
diff --git a/src/node_constants.cc b/src/node_constants.cc
index 149c7c107322919dfeea1dfe89dc223f78b0e979..e4e8dac6b8b5924a7eae83935031e09142554747 100644
--- a/src/node_constants.cc
+++ b/src/node_constants.cc
@@ -241,10 +241,6 @@ void DefineErrnoConstants(Local<Object> target) {
NODE_DEFINE_CONSTANT(target, ENOBUFS);
#endif
-#ifdef ENODATA
- NODE_DEFINE_CONSTANT(target, ENODATA);
-#endif
-
#ifdef ENODEV
NODE_DEFINE_CONSTANT(target, ENODEV);
#endif
@@ -281,14 +277,6 @@ void DefineErrnoConstants(Local<Object> target) {
NODE_DEFINE_CONSTANT(target, ENOSPC);
#endif
-#ifdef ENOSR
- NODE_DEFINE_CONSTANT(target, ENOSR);
-#endif
-
-#ifdef ENOSTR
- NODE_DEFINE_CONSTANT(target, ENOSTR);
-#endif
-
#ifdef ENOSYS
NODE_DEFINE_CONSTANT(target, ENOSYS);
#endif
@@ -369,10 +357,6 @@ void DefineErrnoConstants(Local<Object> target) {
NODE_DEFINE_CONSTANT(target, ESTALE);
#endif
-#ifdef ETIME
- NODE_DEFINE_CONSTANT(target, ETIME);
-#endif
-
#ifdef ETIMEDOUT
NODE_DEFINE_CONSTANT(target, ETIMEDOUT);
#endif
diff --git a/src/node_errors.cc b/src/node_errors.cc
index 69e474257b0427f894375fbc8a2c031f1b8e0c55..f0e968c0dfa8963404c3b87827b8d11a139051cc 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -855,10 +855,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOBUFS);
#endif
-#ifdef ENODATA
- ERRNO_CASE(ENODATA);
-#endif
-
#ifdef ENODEV
ERRNO_CASE(ENODEV);
#endif
@@ -897,14 +893,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOSPC);
#endif
-#ifdef ENOSR
- ERRNO_CASE(ENOSR);
-#endif
-
-#ifdef ENOSTR
- ERRNO_CASE(ENOSTR);
-#endif
-
#ifdef ENOSYS
ERRNO_CASE(ENOSYS);
#endif
@@ -987,10 +975,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ESTALE);
#endif
-#ifdef ETIME
- ERRNO_CASE(ETIME);
-#endif
-
#ifdef ETIMEDOUT
ERRNO_CASE(ETIMEDOUT);
#endif