-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Check Type::Native in isWindows() (f'up to #11917) #5458
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
f87a401
5d41d5d
4e005c4
2d45605
a37a580
2f97117
3afdd72
cf9921d
f8390f1
858169a
7114a34
60f7361
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,6 +42,7 @@ class TestSimplifyTokens : public TestFixture { | |
| mNewTemplate = true; | ||
| TEST_CASE(combine_strings); | ||
| TEST_CASE(combine_wstrings); | ||
| TEST_CASE(combine_wstrings_Windows); | ||
| TEST_CASE(combine_ustrings); | ||
| TEST_CASE(combine_Ustrings); | ||
| TEST_CASE(combine_u8strings); | ||
|
|
@@ -250,6 +251,15 @@ class TestSimplifyTokens : public TestFixture { | |
| ASSERT_EQUALS(expected, tokenizer.tokens()->stringifyList(nullptr, false)); | ||
| } | ||
|
|
||
| void combine_wstrings_Windows() { | ||
| #if defined(_WIN32) && defined(UNICODE) | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That check doesn't seem to make sense. It should default to ANSI if just And I just realized that we only have
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes it is.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
At least I will try to deprecate certain things and make them more generic. But I have already been doing that in a very iterative way for quite a while now. There' just two many things which are entangled and you need to wrap your head around. The built-in platforms are a major pain as they spill into the GUI which makes things even more complicated as they are. |
||
| const char code[] = "const auto* f() {\n" | ||
| " return _T(\"abc\") _T(\"def\") _T(\"ghi\");\n" | ||
| "}"; | ||
| ASSERT_EQUALS("const auto * f ( ) { return L\"abcdefghi\" ; }", tok(code, dinit(TokOptions, $.type = Platform::Type::Native))); | ||
| #endif | ||
| } | ||
|
|
||
| void combine_ustrings() { | ||
| const char code[] = "abcd = u\"ab\" u\"cd\";"; | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you also please add a test for the actual issue you encountered? That would make it much clearer what is intended here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should first decide whether
_T()etc. are tied to a platform or a library. Then we can test if it is properly replaced. Btw, there are more calls toisWindows()which are also affected withnative.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is neither. It is tied to a user(!) defined macro.
It needs to be put into a library though as it comes from the API/headers and not the compiler.
We need to review all code but for now it should be fine to make the proposed change. That's why we have a development cycle so we are allowed to break things temporarily. And it is also why I did it immediately at the beginning of it so we have the time we need. For now I would just like to see a test for the actual problem you encountered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that we even have platform-dependent types in windows.cfg (e.g.
TCHAR).