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 the library do C++ things when compiling as C++ #3

Merged
merged 2 commits into from
Feb 10, 2019

Conversation

RealKC
Copy link
Contributor

@RealKC RealKC commented Feb 9, 2019

This PR makes use of the preprocessor to add C++ specific things to the library when compiling for C++.

What this PR adds:

  • A macro FASTMOD_API that expands to static inline when compiling for C, but to nothing when compiling for C++.
  • A namespace fastmod within an unnamed namespace for what I believe to do the same as static inline in C, this effect is probably only applicable on C++11 and above though(unless I'm reading the section about this on cppreference.com wrong).

There were also some comments added to make the preprocessor logic easier to follow(imo). If there's anything you'd like me to change, please tell me.

@lemire
Copy link
Owner

lemire commented Feb 10, 2019

This looks nice!

@lemire lemire merged commit 9769632 into lemire:master Feb 10, 2019
@RealKC RealKC mentioned this pull request Feb 10, 2019
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.

None yet

2 participants