Skip to content

Added C++ compatibility macros#887

Open
arvillacl16-bit wants to merge 1 commit into
hannorein:mainfrom
arvillacl16-bit:cpp-compat
Open

Added C++ compatibility macros#887
arvillacl16-bit wants to merge 1 commit into
hannorein:mainfrom
arvillacl16-bit:cpp-compat

Conversation

@arvillacl16-bit
Copy link
Copy Markdown

Wrap the REBOUND API in a conditional extern "C" block so it can be safely
included in C++ projects. Preserve the REB_RESTRICT and restrict macros,
conditionally defining them for compiler portability (MSVC, GCC, Clang).
No source files are modified.

@hannorein
Copy link
Copy Markdown
Owner

Couldn't you just wrap the #include "rebound.h" statement in an extern "C" { } block?

@arvillacl16-bit
Copy link
Copy Markdown
Author

Most dual headers add it anyway in the header because even though it is a simple fix, it is still boilerplate nonetheless.

@hannorein
Copy link
Copy Markdown
Owner

Ok. I'm working on some other changes to the header files. So I'll keep this open for now, but will add it at some pointer later.

Are you still working on your c++ version?

@arvillacl16-bit
Copy link
Copy Markdown
Author

No. There was too much c specific source stuff like WHFast relying on uninitialized memory. I might just look at the formulas. I have ditched that project and started a new one.

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