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

In C++, there are many keyword conflicts with variable names. #43

Closed
NickPak opened this issue Dec 16, 2020 · 7 comments
Closed

In C++, there are many keyword conflicts with variable names. #43

NickPak opened this issue Dec 16, 2020 · 7 comments

Comments

@NickPak
Copy link

NickPak commented Dec 16, 2020

In C++, there are many keyword conflicts with variable names. I‘m going to commit a PR for this, which will make the following changes:
namespace => name_space
template => template_
operator => operator_
export => export_
Does it follow your code style?

@ityuhui
Copy link
Member

ityuhui commented Dec 16, 2020

Hi @NickPak

Thank you for your working in C++ !
The code is generated by openapi-generator/c-libcurl https://github.com/OpenAPITools/openapi-generator, so your change will be overwritten by next re-generating.

I think it's better to add these keywords into setReservedWordsLowerCase in https://github.com/OpenAPITools/openapi-generator/blob/master/modules/openapi-generator/src/main/java/org/openapitools/codegen/languages/CLibcurlClientCodegen.java

Although setReservedWordsLowerCase is used to hold the C keyword, I think adding C++ keyword to it is OK.

@NickPak
Copy link
Author

NickPak commented Dec 16, 2020

@ityuhui Thanks!

@ityuhui
Copy link
Member

ityuhui commented Dec 16, 2020

Please try to commit your PR into openapi-generator, after your PR is merged, I can work with you to re-generate the c client code here. And then it will work with C++.

Any question, feel free to append here.

@NickPak
Copy link
Author

NickPak commented Dec 16, 2020

Hi @ityuhui
I have committed it. Thanks very much!

@ityuhui
Copy link
Member

ityuhui commented Jan 6, 2021

Hi @NickPak

I have merged your change OpenAPITools/openapi-generator#8205 and re-generate the client code by this PR #45.
So I think the C client can be compiled by C++ compiler now, could you please fetch the latest code to try ? Thanks.

@NickPak
Copy link
Author

NickPak commented Jan 7, 2021

Hi @ityuhui
It works fine for me! Thanks very much!

@NickPak NickPak closed this as completed Jan 7, 2021
@ityuhui
Copy link
Member

ityuhui commented Jan 9, 2021

Thank you for your contribution for C++ support !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants