Skip to content

Instantly share code, notes, and snippets.

@graphitemaster
Created January 24, 2014 19:31
Show Gist options
  • Select an option

  • Save graphitemaster/8604351 to your computer and use it in GitHub Desktop.

Select an option

Save graphitemaster/8604351 to your computer and use it in GitHub Desktop.
How to prevent cyclic includes in C/C++
#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