electron/patches/node/fix_remove_deprecated_errno_constants.patch
electron-roller[bot] bc163a5ea8
chore: bump node to v22.13.1 (35-x-y) (#45216)
* chore: bump node in DEPS to v22.13.0

* chore: bump node in DEPS to v22.13.1

* src: move evp stuff to ncrypto

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

* crypto: add Date fields for validTo and validFrom

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

* module: fix discrepancy between .ts and .js

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

* esm: do not interpret "main" as a URL

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

* src: modernize likely/unlikely hints

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

* chore: update patch indices

* crypto: add validFromDate and validToDate fields to X509Certificate

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

* chore: fixup perfetto patch

* fix: clang warning in simdjson

* src: add receiver to fast api callback methods

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

* chore: fixup revert patch

* fixup! esm: do not interpret "main" as a URL

* fixup! crypto: add Date fields for validTo and validFrom

* fix: move ArrayBuffer test patch

* src: fixup Error.stackTraceLimit during snapshot building

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

* fix: bad rebase

* chore: fixup amaro

* chore: address feedback from review

* src: revert filesystem::path changes

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

* chore: fixup GN build file

* https://github.com/nodejs/node/pull/55529
* https://github.com/nodejs/node/pull/55798
* https://github.com/nodejs/node/pull/55530

* module: simplify --inspect-brk handling

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

* src: fix outdated js2c.cc references

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

* crypto: include openssl/rand.h explicitly

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

* build: use variable for crypto dep path

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

* crypto: fix RSA_PKCS1_PADDING error message

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

* build: use variable for simdutf path

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

* test,crypto: make crypto tests work with BoringSSL

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

* fix: suppress clang -Wdeprecated-declarations in libuv

https://github.com/libuv/libuv/pull/4486

* deps: update libuv to 1.49.1

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

* test: make test-node-output-v8-warning more flexible

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

* [v22.x] Revert "v8: enable maglev on supported architectures"

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

* fix: potential WIN32_LEAN_AND_MEAN redefinition

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

* deps: update nghttp2 to 1.64.0

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

* src: provide workaround for container-overflow

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

* build: use variable for simdutf path

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

* chore: fixup patch indices

* fixup! module: simplify --inspect-brk handling

* lib: fix fs.readdir recursive async

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

* lib: avoid excluding symlinks in recursive fs.readdir with filetypes

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

This doesn't currently play well with ASAR - this should be fixed in a follow up

* test: disable CJS permission test for config.main

This has diverged as a result of our revert of
src,lb: reducing C++ calls of esm legacy main resolve

* fixup! lib: fix fs.readdir recursive async

* deps: update libuv to 1.49.1

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

---------

Co-authored-by: electron-roller[bot] <84116207+electron-roller[bot]@users.noreply.github.com>
Co-authored-by: Shelley Vohr <shelley.vohr@gmail.com>
2025-02-14 15:53:34 +01: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 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 65f95c3157add2afca26a133183b65ccba6e9924..81091d364d32094dc91c7abb0c5fe9963d100a8b 100644
--- a/src/node_errors.cc
+++ b/src/node_errors.cc
@@ -857,10 +857,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ENOBUFS);
#endif
-#ifdef ENODATA
- ERRNO_CASE(ENODATA);
-#endif
-
#ifdef ENODEV
ERRNO_CASE(ENODEV);
#endif
@@ -899,14 +895,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
@@ -989,10 +977,6 @@ const char* errno_string(int errorno) {
ERRNO_CASE(ESTALE);
#endif
-#ifdef ETIME
- ERRNO_CASE(ETIME);
-#endif
-
#ifdef ETIMEDOUT
ERRNO_CASE(ETIMEDOUT);
#endif