From 601ca745c162b38ec482d05bc2d990dfa4eadbad Mon Sep 17 00:00:00 2001 From: Milan Burda Date: Wed, 11 May 2022 10:02:48 +0200 Subject: [PATCH] fix: building node modules with Visual Studio 2017 (#34110) --- patches/v8/.patches | 2 +- ...recated_attribute_for_older_msvc_versions.patch} | 13 +++++-------- 2 files changed, 6 insertions(+), 9 deletions(-) rename patches/v8/{fix_build_deprecated_attirbute_for_older_msvc_versions.patch => fix_build_deprecated_attribute_for_older_msvc_versions.patch} (72%) diff --git a/patches/v8/.patches b/patches/v8/.patches index 1e5615f3ce254..67b42548459b7 100644 --- a/patches/v8/.patches +++ b/patches/v8/.patches @@ -4,6 +4,6 @@ dcheck.patch export_symbols_needed_for_windows_build.patch workaround_an_undefined_symbol_error.patch do_not_export_private_v8_symbols_on_windows.patch -fix_build_deprecated_attirbute_for_older_msvc_versions.patch +fix_build_deprecated_attribute_for_older_msvc_versions.patch fix_disable_implies_dcheck_for_node_stream_array_buffers.patch revert_fix_cppgc_removed_deleted_cstors_in_cppheapcreateparams.patch diff --git a/patches/v8/fix_build_deprecated_attirbute_for_older_msvc_versions.patch b/patches/v8/fix_build_deprecated_attribute_for_older_msvc_versions.patch similarity index 72% rename from patches/v8/fix_build_deprecated_attirbute_for_older_msvc_versions.patch rename to patches/v8/fix_build_deprecated_attribute_for_older_msvc_versions.patch index ad3c1b6198b4c..3ea23d6657b6f 100644 --- a/patches/v8/fix_build_deprecated_attirbute_for_older_msvc_versions.patch +++ b/patches/v8/fix_build_deprecated_attribute_for_older_msvc_versions.patch @@ -1,15 +1,12 @@ From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Deepak Mohan Date: Tue, 28 Jan 2020 15:48:03 -0800 -Subject: fix: usage of c++ [[deprecated]] attirbute for older msvc versions +Subject: fix: usage of c++ [[deprecated]] attribute for older msvc versions -VS 2015 update 3 has a bug where [[deprecated]] attribute cannot -be applied to constructor declarations, this is fixed in 2017 and -higher versions, but native module compiling with this version -will have an issue. +This attribute can only be used in all contexts in Visual Studio 2019 diff --git a/include/v8config.h b/include/v8config.h -index b16ab3ff88d1054d12af4de3ad0018c97c0b7fcc..c9963b43c121964c0c37c858adb228cd090d5c2a 100644 +index b16ab3ff88d1054d12af4de3ad0018c97c0b7fcc..09f1a1b9a6aa8c7d08121725c8447e95209ec7b6 100644 --- a/include/v8config.h +++ b/include/v8config.h @@ -452,10 +452,13 @@ path. Add it with -I to the command line @@ -20,7 +17,7 @@ index b16ab3ff88d1054d12af4de3ad0018c97c0b7fcc..c9963b43c121964c0c37c858adb228cd // A macro (V8_DEPRECATED) to mark classes or functions as deprecated. #if defined(V8_DEPRECATION_WARNINGS) -# define V8_DEPRECATED(message) [[deprecated(message)]] -+# if defined(_MSC_VER) && _MSC_VER <= 1900 ++# if !defined(__clang__) && defined(_MSC_VER) && _MSC_VER < 1920 +# define V8_DEPRECATED(message) __declspec(deprecated(message)) +# else +# define V8_DEPRECATED(message) [[deprecated(message)]] @@ -33,7 +30,7 @@ index b16ab3ff88d1054d12af4de3ad0018c97c0b7fcc..c9963b43c121964c0c37c858adb228cd // A macro (V8_DEPRECATE_SOON) to make it easier to see what will be deprecated. #if defined(V8_IMMINENT_DEPRECATION_WARNINGS) -# define V8_DEPRECATE_SOON(message) [[deprecated(message)]] -+# if defined(_MSC_VER) && _MSC_VER <= 1900 ++# if !defined(__clang__) && defined(_MSC_VER) && _MSC_VER < 1920 +# define V8_DEPRECATE_SOON(message) __declspec(deprecated(message)) +# else +# define V8_DEPRECATE_SOON(message) [[deprecated(message)]]