Can anyone help me understand #pragma?
ifndef TARGET_OS_LINUX #pragma once endif
What,when, where, why, an example?
The above is in some code that I am refactoring....
#pragma
is just the prefix for a compiler-specific feature.
In this case, #pragma once
means that this header file will only ever be included once in a specific destination file. It removes the need for include guards.
"Header guards are little pieces of code that protect the contents of a header file from being included more than once."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With