-
Notifications
You must be signed in to change notification settings - Fork 24
Make public headers C++-compatible #31
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
Conversation
00bf56d
to
4d47197
Compare
@mta452 Could you please take a look at this and my other 2 PRs? They make it easier to use SheenBidi in C++. |
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. |
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. |
C and C++ are different languages but are part of the same ecosystem. 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
Sure, for the future PRs. Though often having the code makes the discussion easier and makes the effort needed for the implementation clearer. |
I'm open to adding support for |
The plain ifdef blocks are what's usually used. We could define something like this in SBBase.h instead: #ifdef __cplusplus
#define SB_EXTERN_C_BEGIN extern "C" {
#define SB_EXTERN_C_END }
#else
#define SB_EXTERN_C_BEGIN
#define SB_EXTERN_C_END
#endif I don't think it's necessarily worth it but if you prefer it I can update this PR to use these macros |
Allow `#include <SheenBidi.h>` in C++ without having to wrap it in `extern "C"`.
Changed to macros and retargeted to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, looks good to me 👍
Allow
#include <SheenBidi.h>
in C++ without having to wrap it inextern "C"
.