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

Add support for C++ #130

Closed
wants to merge 1 commit into from
Closed

Add support for C++ #130

wants to merge 1 commit into from

Conversation

ysc3839
Copy link
Contributor

@ysc3839 ysc3839 commented Sep 25, 2020

Previous pull request #118 was closed accidentally.

Add preprocessor definitions (macros) with git info to C++ and resource compiler.

Using this way is because there's no easy way to inject global variables into a source file. Users are required to include a header in order to use generated git info.
And C++ has multiple char types, for example "str" is char[] and L"str" wchar_t[]. And there's no easy way to do a compile-time conversion.
But with macros, we can just use a macro like #define WSTRIFY(s) L##s to make it become wchar_t[]
Also the resource compiler doesn't support global variables, but macros are supported.

Currently there's a issue that Visual Studio says identifier "GIT_*" is undefined. A solution is to write a stub header file that checks existence these macros and define them if not exist.

Another option is to generate a header file with preprocessor definitions, and let user manually include it. Which one is better?

May closes #67, but I'm not familiar with managed C++.

@kzu
Copy link
Member

kzu commented Aug 26, 2021

Closing for now from lack of movement and since there seem to be a couple issues mentioned that still don't work (from my basic understanding of the PR description). Lack of support for managed C++ also seems to be a drawback.

@kzu kzu closed this Aug 26, 2021
@devlooped devlooped locked and limited conversation to collaborators Sep 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Can the same be used for managed C++? If not create it?
2 participants