kubernetes-client / c

Official C client library for Kubernetes
Apache License 2.0
144 stars 46 forks source link

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

Closed NickPak closed 3 years ago

NickPak commented 3 years ago

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 commented 3 years ago

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 commented 3 years ago

@ityuhui Thanks!

ityuhui commented 3 years ago

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 commented 3 years ago

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

ityuhui commented 3 years ago

Hi @NickPak

I have merged your change https://github.com/OpenAPITools/openapi-generator/pull/8205 and re-generate the client code by this PR https://github.com/kubernetes-client/c/pull/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 commented 3 years ago

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

ityuhui commented 3 years ago

Thank you for your contribution for C++ support !