electron/patches/node/fix_remove_deprecated_errno_constants.patch
electron-roller[bot] cb445b3bbd
chore: bump node to v22.15.0 (main) (#46742)
* chore: bump node in DEPS to v22.15.0

* inspector: fix GN build

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

* test: search cctest files

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

* crypto: fix missing OPENSSL_NO_ENGINE guard

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

* test,crypto: make tests work for BoringSSL

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

* module: use synchronous hooks for preparsing in import(cjs)

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

* deps: update simdjson to 3.12.0

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

* build: remove explicit linker call to libm on macOS

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

* test: make eval snapshot comparison more flexible

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

* src: allow embedder customization of OOMErrorHandler

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

* src: do not pass nullptr to std::string ctor

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

* src: lock the isolate properly in IsolateData destructor

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

* chore: shrink --trace-atomics-wait patch

* chore: fixup patch indices

* build: fix GN build failure

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

* crypto: expose security levels

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

* zlib: add zstd support

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

* test: move crypto related common utilities in common/crypto

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

* cli: move --trace-atomics-wait to eol

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

* test: disable test-https-client-renegotiation-limit

BoringSSL doesn't support caller-initiated renegotiation - see
https://source.chromium.org/chromium/chromium/src/+/main:third_party/boringssl/src/ssl/ssl_lib.cc;l=1627-1631

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-05-05 10:23:17 +02: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 f75a496071ac3396cbc6dec819eaab7294609deb..30f9a05f2f508b55a7d7ae036612660068c8400e 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 13263149c111beede83b7063fa54f56655aea54c..99068098e1867af4846e18a5d039a25689722a4a 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 5f51add4cdf68a9487edfc9382f586cc94539571..befb642f1effa3c4139e4cd99ff64d9c5175fd72 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -862,10 +862,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOBUFS);
#endif
-#ifdef ENODATA
- ERRNO_CASE(ENODATA);
-#endif
-
#ifdef ENODEV
ERRNO_CASE(ENODEV);
#endif
@@ -904,14 +900,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
@@ -994,10 +982,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ESTALE);
#endif
-#ifdef ETIME
- ERRNO_CASE(ETIME);
-#endif
-
#ifdef ETIMEDOUT
ERRNO_CASE(ETIMEDOUT);
#endif