Skip to content

Commit

Permalink
fix: building node modules with Visual Studio 2017 (#34109)
Browse files Browse the repository at this point in the history
  • Loading branch information
miniak committed May 10, 2022
1 parent 627c298 commit e76cf3e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion patches/v8/.patches
Expand Up @@ -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
@@ -1,15 +1,12 @@
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Deepak Mohan <hop2deep@gmail.com>
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 77fd65c6c5b7d8c0a7fe7a37c40e17ce66f49ce6..010b3633546601ba70a55aeb8e8fc503ef79e2f5 100644
index 77fd65c6c5b7d8c0a7fe7a37c40e17ce66f49ce6..d203053d41c702733f5f3b950aa31cef74c2ab57 100644
--- a/include/v8config.h
+++ b/include/v8config.h
@@ -454,10 +454,13 @@ path. Add it with -I<path> to the command line
Expand All @@ -20,7 +17,7 @@ index 77fd65c6c5b7d8c0a7fe7a37c40e17ce66f49ce6..010b3633546601ba70a55aeb8e8fc503
// 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)]]
Expand All @@ -33,7 +30,7 @@ index 77fd65c6c5b7d8c0a7fe7a37c40e17ce66f49ce6..010b3633546601ba70a55aeb8e8fc503
// 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)]]
Expand Down

0 comments on commit e76cf3e

Please sign in to comment.