Created
January 24, 2014 19:31
-
-
Save graphitemaster/8604351 to your computer and use it in GitHub Desktop.
How to prevent cyclic includes in C/C++
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #if NAME_HDR == 1 | |
| # warning "Cyclic include" | |
| #endif | |
| #ifndef NAME_HDR | |
| #define NAME_HDR 1 | |
| put_stuff_here; | |
| #undef NAME_HDR | |
| #define NAME_HDR 0 | |
| #endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment