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

Add #pragma once standard include guard fallback #34

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

Zorgatone
Copy link
Contributor

No description provided.

@nabijaczleweli
Copy link
Contributor

👎 #pragma once is supported by every compiler and #define guards are potentially slower.

@refi64
Copy link

refi64 commented Jan 22, 2016

Potentially slower by 1/10000th second...

@nabijaczleweli
Copy link
Contributor

Potentially slower by an HDD access, at least keep the #pragma once on top of the include guard.

@tapio
Copy link
Owner

tapio commented Jan 22, 2016

While not standard, #pragma once is pretty universally supported and it's much nicer than include guards. Granted, with just one header, it's kind of moot... Anyway, I'd be interested to know your compiler name and version if it really choked on it.

@Zorgatone
Copy link
Contributor Author

My compiler supports it. I'm just suggesting to keep it standard. It's
better this way just to be sure.

It's not that slow imho

@Zorgatone
Copy link
Contributor Author

Edited to use both the #pragma once and standard include guard (fallback)

as discussed on stackoverflow: https://stackoverflow.com/questions/787533/is-pragma-once-a-safe-include-guard
and: https://stackoverflow.com/questions/1143936/pragma-once-vs-include-guards

@Zorgatone Zorgatone changed the title Don't use non-standard #pragma once Add #pragma once standard include guard fallback Jan 25, 2016
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

4 participants