Skip to content

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.

@@ -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.

3 participants