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

Make public headers C++-compatible #31

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

glebm
Copy link
Contributor

@glebm glebm commented Feb 2, 2025

Allow #include <SheenBidi.h> in C++ without having to wrap it in extern "C".

@glebm glebm force-pushed the cpp-guards branch 2 times, most recently from 00bf56d to 4d47197 Compare February 5, 2025 22:19
@glebm
Copy link
Contributor Author

glebm commented Feb 7, 2025

@mta452 Could you please take a look at this and my other 2 PRs? They make it easier to use SheenBidi in C++.

@mta452
Copy link
Member

mta452 commented Feb 8, 2025

This was raised previously in issue #7 as well. However, I intentionally want to avoid adding support for other languages in the main library itself to keep things simple. I feel it makes more sense to handle such cases in the target language.

@mta452
Copy link
Member

mta452 commented Feb 8, 2025

Can you please discuss the ideas in a ticket before actually starting the implementation? It would be beneficial to discuss the pros and cons beforehand.

@glebm
Copy link
Contributor Author

glebm commented Feb 8, 2025

I feel it makes more sense to handle such cases in the target language.

C and C++ are different languages but are part of the same ecosystem.
As this is the only thing needed to achieve C++ compatibility, C libraries generally do this.

For example: all GNU libraries (e.g. gettext), SDL, Linux support libraries (e.g. liburing), etc.

This makes it easier for C++ users and does not have any maintenance overhead. On the other hand, as this library becomes more popular (and I believe it will), some maintenance effort will be spent replying to issues that people open about this.

This is not a major issue of course but it'd be nice to not have to explain to C++ developers (who may not even be familiar with extern) that SheenBidi needs special handling.

Can you please discuss the ideas in a ticket before actually starting the implementation? It would be beneficial to discuss the pros and cons beforehand.

Sure, for the future PRs. Though often having the code makes the discussion easier and makes the effort needed for the implementation clearer.

Allow `#include <SheenBidi.h>` in C++ without having
to wrap it in `extern "C"`.
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

Successfully merging this pull request may close these issues.

2 participants