Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Add 'extern' statements to public headers for C++ compatibility #450

Merged
merged 2 commits into from
Jul 14, 2024

Conversation

andrjohns
Copy link
Contributor

Currently only the quickjs.h and quicks-libc.h have extern "C" statements for compiling under C++, this PR adds them to the other public headers

cutils.h Outdated
Comment on lines 32 to 38
#ifdef __cplusplus
extern "C" {
#endif

#if defined(_WIN32)
#include <windows.h>
#endif
Copy link
Collaborator

@chqrlie chqrlie Jul 1, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the #include <windows.h> should be outside the extern "C" block. Unless there is a compelling reason not to, you should move the patch down 4 lines.

@chqrlie chqrlie merged commit 7faef86 into quickjs-ng:master Jul 14, 2024
50 checks passed
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants