forked from electron/electron
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: compilation of native modules on windows with older msvc versions (
- Loading branch information
1 parent
bc0f5ac
commit ca515ae
Showing
2 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
43 changes: 43 additions & 0 deletions
43
patches/v8/fix_build_deprecated_attirbute_for_older_msvc_versions.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 | ||
From: Deepak Mohan <[email protected]> | ||
Date: Tue, 28 Jan 2020 15:48:03 -0800 | ||
Subject: fix: usage of c++ [[deprecated]] attirbute 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. | ||
|
||
diff --git a/include/v8config.h b/include/v8config.h | ||
index 40d23c35c186e4def1fcf59c28527de292d9fd7a..7d1ef7b5bf0ff6693b8a04afc1e319219c14e230 100644 | ||
--- a/include/v8config.h | ||
+++ b/include/v8config.h | ||
@@ -388,10 +388,13 @@ | ||
# define V8_NOINLINE /* NOT SUPPORTED */ | ||
#endif | ||
|
||
- | ||
// 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 | ||
+# define V8_DEPRECATED(message) __declspec(deprecated(message)) | ||
+# else | ||
+# define V8_DEPRECATED(message) [[deprecated(message)]] | ||
+# endif | ||
#else | ||
# define V8_DEPRECATED(message) | ||
#endif | ||
@@ -399,7 +402,11 @@ | ||
|
||
// 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 | ||
+# define V8_DEPRECATE_SOON(message) __declspec(deprecated(message)) | ||
+# else | ||
+# define V8_DEPRECATE_SOON(message) [[deprecated(message)]] | ||
+# endif | ||
#else | ||
# define V8_DEPRECATE_SOON(message) | ||
#endif |