Skip to content
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

ImportC add Windows cl preprocessor #define support #14151

Merged
merged 1 commit into from May 24, 2022

Conversation

WalterBright
Copy link
Member

Trying it out with Microsoft's preprocessor

@WalterBright WalterBright added the ImportC Pertaining to ImportC support label May 20, 2022
@dlang-bot
Copy link
Contributor

Thanks for your pull request, @WalterBright!

Bugzilla references

Your PR doesn't reference any Bugzilla issue.

If your PR contains non-trivial changes, please reference a Bugzilla issue or create a manual changelog.

Testing this PR locally

If you don't have a local development environment setup, you can use Digger to test this PR:

dub run digger -- build "master + dmd#14151"

@WalterBright WalterBright force-pushed the preprocessCl branch 2 times, most recently from 33292cc to aa71fbf Compare May 21, 2022 00:47
@adamdruppe
Copy link
Contributor

How does that testdefine.c actually test the translation? Wouldn't the preprocessor just change that static assert to 3 == 3 without confirming the symbol is seen by D?

@adamdruppe
Copy link
Contributor

cool

@WalterBright
Copy link
Member Author

The following operation failed:
Name: checkwhitespace

It sure would be nice if checkwhitespace bothered to say which file failed. I can't find any files with tabs in them.

@WalterBright
Copy link
Member Author

The code is actually working, the errors are of the form:

 fail_compilation\testTypeof.c(8): Error: `typeof` operator expects an expression or type name in parentheses
 fail_compilation\testTypeof.c(8): Error: identifier or `(` expected
+testTypeof.c

i.e. cl is insisting on randomly inserting the filename into stdout.

@WalterBright WalterBright force-pushed the preprocessCl branch 4 times, most recently from 346444d to cc12cfc Compare May 22, 2022 03:14
@WalterBright
Copy link
Member Author

I'm lost. I don't know where cl is writing the #define's to. It's not emitted to stdout (like sppn.exe does), and it's not in the preprocessed output file (like cpp does). My cl program is too old to support the /PD switch for cl.

Can anyone with a post-2020 cl investigate and let me know? Thanks!

@12345swordy
Copy link
Contributor

12345swordy commented May 23, 2022

What is exactly preventing you from installing the latest VC Walter?

@WalterBright WalterBright force-pushed the preprocessCl branch 2 times, most recently from cbf3434 to a922e44 Compare May 23, 2022 02:43
@WalterBright WalterBright force-pushed the preprocessCl branch 11 times, most recently from a1bd9f8 to 5aad50b Compare May 24, 2022 03:06
@WalterBright WalterBright force-pushed the preprocessCl branch 5 times, most recently from 943eb25 to 9ecd9f0 Compare May 24, 2022 05:43
@WalterBright
Copy link
Member Author

I found the problem. Thanks @rainers for your help!

It's working now, except for some strange problem with the auto-tester that seems completely unrelated.

@RazvanN7
Copy link
Contributor

@WalterBright There were some tabs introduced in #14153. But that was fixed by: #14154 . I rebased this PR and everything should be ok now.

@WalterBright WalterBright merged commit 730d8c1 into dlang:master May 24, 2022
@WalterBright WalterBright deleted the preprocessCl branch May 24, 2022 16:17
thewilsonator pushed a commit to thewilsonator/dmd that referenced this pull request May 26, 2022
thewilsonator pushed a commit to thewilsonator/dmd that referenced this pull request May 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ImportC Pertaining to ImportC support
Projects
None yet
5 participants