Preprocessor Macros: Difference between revisions
| (2 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
Some common preprocessor macros | Some common preprocessor macros | ||
==Include Guard== | |||
For most modern compilers (MS Visual C++, GCC, Clang/llvm), you can just add a <code>#pragma once</code> at the top.<br> | |||
Note that this is not defined in the standard but [[Wikipedia: pragma once#Portability]] lists support for most common compilers. | |||
For older compilers: | |||
<syntaxhighlight lang="c"> | |||
#ifndef GRANDPARENT_H | |||
#define GRANDPARENT_H | |||
... contents of grandparent.h | |||
#endif /* !GRANDPARENT_H */ | |||
</syntaxhighlight> | |||
==GLSL== | ==GLSL== | ||