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

Treat cpp2's C code as truly internal and get rid of #ifdef __cplusplus namespace capi #432

Closed
Manishearth opened this issue Feb 21, 2024 · 2 comments · Fixed by #512
Closed
Labels
B-cpp C++ backend
Milestone

Comments

@Manishearth
Copy link
Contributor

Manishearth commented Feb 21, 2024

The C++ backend generates C code in namespace capi {} when run by a C++ compiler.

Instead of doing this, we should:

  • generate .hpp files in a capi/ folder
  • have them unconditionally contain namespace capi and extern "C".

This API shall primarily be internal but can be used by people who want to poke into ICU4X's guts.

@Manishearth Manishearth changed the title Treat cpp Treat cpp2's C code as truly internal and get rid of #ifdef __cplusplus Feb 21, 2024
@Manishearth Manishearth changed the title Treat cpp2's C code as truly internal and get rid of #ifdef __cplusplus Treat cpp2's C code as truly internal and get rid of #ifdef __cplusplus namespace capi Feb 21, 2024
@Manishearth
Copy link
Contributor Author

Also we should call it __capi

@Manishearth Manishearth added this to the ICU4X 2.0 milestone Jun 28, 2024
@Manishearth Manishearth added the B-cpp C++ backend label Jun 28, 2024
@Manishearth
Copy link
Contributor Author

#495

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
B-cpp C++ backend
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant