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

[WIP] C API #83

Draft
wants to merge 23 commits into
base: master
Choose a base branch
from
Draft

[WIP] C API #83

wants to merge 23 commits into from

Conversation

wavefunction91
Copy link
Owner

No description provided.

@@ -0,0 +1,146 @@
#pragma once
Copy link
Collaborator

Choose a reason for hiding this comment

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

It might be a good idea to use the standard C approach here, as #pragma once appears to be compiler dependent..

Copy link
Owner Author

Choose a reason for hiding this comment

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

If a compiler doesn't support pragma once, the rest of the stack won't compile either. This is a conscious design decision. Show me a modern compiler that doesn't support pragma once, and we can reconsider that choice. From this list, it seems that everything that we can reasonably support supports this paradigm

https://en.m.wikipedia.org/wiki/Pragma_once

NB, This may preclude some embedded compilers/platforms, but the fact that we're doing dynamic memory management (i.e. calls to malloc/new) already precludes them - if there's a reason to target these platforms, we'd have to do a rather large overhaul of everything and pragma once would be the least of our problems.

src/c_api/c_api.c Outdated Show resolved Hide resolved
src/c_api/c_radial.cxx Outdated Show resolved Hide resolved
src/c_api/c_api.c Show resolved Hide resolved
src/c_api/c_radial.cxx Outdated Show resolved Hide resolved
@@ -0,0 +1,146 @@
#pragma once
Copy link
Owner Author

Choose a reason for hiding this comment

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

If a compiler doesn't support pragma once, the rest of the stack won't compile either. This is a conscious design decision. Show me a modern compiler that doesn't support pragma once, and we can reconsider that choice. From this list, it seems that everything that we can reasonably support supports this paradigm

https://en.m.wikipedia.org/wiki/Pragma_once

NB, This may preclude some embedded compilers/platforms, but the fact that we're doing dynamic memory management (i.e. calls to malloc/new) already precludes them - if there's a reason to target these platforms, we'd have to do a rather large overhaul of everything and pragma once would be the least of our problems.

@susilehtola
Copy link
Collaborator

susilehtola commented Sep 25, 2023 via email

@wavefunction91
Copy link
Owner Author

@susilehtola Ohhh, I see. That was just because it wasn't fleshed out - the differences are apparent now

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