-
Notifications
You must be signed in to change notification settings - Fork 6.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[chakracore] Avoid using MSVC-internal _STRINGIZE (#37242)
Microsoft's C++ standard library recently merged microsoft/STL#4405 to remove the internal `_STRINGIZE` macro. `chakracore` was using this MSVC internal macro, so `avoid_msvc_internal_STRINGIZE.patch` was added to adapt it to the microsoft/STL changes. Reference: chakra-core/ChakraCore#6970. - [x] Changes comply with the [maintainer guide](https://github.com/microsoft/vcpkg-docs/blob/main/vcpkg/contributing/maintainer-guide.md). - [ ] ~SHA512s are updated for each updated download.~ - [ ] ~The "supports" clause reflects platforms that may be fixed by this new version.~ - [ ] ~Any fixed [CI baseline](https://github.com/microsoft/vcpkg/blob/master/scripts/ci.baseline.txt) entries are removed from that file.~ - [ ] ~Any patches that are no longer applied are deleted from the port's directory.~ - [x] The version database is fixed by rerunning `./vcpkg x-add-version --all` and committing the result. - [x] Only one version is added to each modified port's versions file. --------- Co-authored-by: Monica <[email protected]>
- Loading branch information
1 parent
0df5f80
commit 4f55503
Showing
5 changed files
with
86 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,78 @@ | ||
diff --git a/bin/NativeTests/stdafx.h b/bin/NativeTests/stdafx.h | ||
index c7a021c..77f8299 100644 | ||
--- a/bin/NativeTests/stdafx.h | ||
+++ b/bin/NativeTests/stdafx.h | ||
@@ -25,11 +25,16 @@ | ||
|
||
#define DebugOnly(x) x | ||
|
||
+#if !defined(CHAKRACORE_STRINGIZE) | ||
+#define CHAKRACORE_STRINGIZE_IMPL(x) #x | ||
+#define CHAKRACORE_STRINGIZE(x) CHAKRACORE_STRINGIZE_IMPL(x) | ||
+#endif | ||
+ | ||
#define AssertMsg(exp, comment) \ | ||
do { \ | ||
if (!(exp)) \ | ||
{ \ | ||
- fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, _STRINGIZE(exp), comment); \ | ||
+ fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, CHAKRACORE_STRINGIZE(exp), comment); \ | ||
fflush(stderr); \ | ||
DebugBreak(); \ | ||
} \ | ||
diff --git a/bin/ch/stdafx.h b/bin/ch/stdafx.h | ||
index 450a33d..7c5ecc2 100644 | ||
--- a/bin/ch/stdafx.h | ||
+++ b/bin/ch/stdafx.h | ||
@@ -57,16 +57,16 @@ | ||
|
||
#if defined(DBG) | ||
|
||
-#define _STRINGIZE_(x) #x | ||
-#if !defined(_STRINGIZE) | ||
-#define _STRINGIZE(x) _STRINGIZE_(x) | ||
+#if !defined(CHAKRACORE_STRINGIZE) | ||
+#define CHAKRACORE_STRINGIZE_IMPL(x) #x | ||
+#define CHAKRACORE_STRINGIZE(x) CHAKRACORE_STRINGIZE_IMPL(x) | ||
#endif | ||
|
||
#define AssertMsg(exp, comment) \ | ||
do { \ | ||
if (!(exp)) \ | ||
{ \ | ||
- fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, _STRINGIZE(exp), comment); \ | ||
+ fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, CHAKRACORE_STRINGIZE(exp), comment); \ | ||
fflush(stderr); \ | ||
DebugBreak(); \ | ||
} \ | ||
diff --git a/pal/inc/assert_only.h b/pal/inc/assert_only.h | ||
index eef0e62..644460c 100644 | ||
--- a/pal/inc/assert_only.h | ||
+++ b/pal/inc/assert_only.h | ||
@@ -6,20 +6,22 @@ | ||
// PAL free Assert definitions | ||
#ifdef DEBUG | ||
|
||
-#define _QUOTE_(s) #s | ||
-#define _STRINGIZE_(s) _QUOTE_(s) | ||
+#if !defined(CHAKRACORE_STRINGIZE) | ||
+#define CHAKRACORE_STRINGIZE_IMPL(x) #x | ||
+#define CHAKRACORE_STRINGIZE(x) CHAKRACORE_STRINGIZE_IMPL(x) | ||
+#endif | ||
|
||
#ifndef __ANDROID__ | ||
#define _ERR_OUTPUT_(condition, comment) \ | ||
fprintf(stderr, "ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, \ | ||
- _STRINGIZE_(condition), comment); \ | ||
+ CHAKRACORE_STRINGIZE(condition), comment); \ | ||
fflush(stderr); | ||
#else // ANDROID | ||
#include <android/log.h> | ||
#define _ERR_OUTPUT_(condition, comment) \ | ||
__android_log_print(ANDROID_LOG_ERROR, "chakracore-log", \ | ||
"ASSERTION (%s, line %d) %s %s\n", __FILE__, __LINE__, \ | ||
- _STRINGIZE_(condition), comment); | ||
+ CHAKRACORE_STRINGIZE(condition), comment); | ||
#endif | ||
|
||
#define _Assert_(condition, comment) \ |
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
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
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
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