TheCherno / Sparky

Cross-Platform High Performance 2D/3D game engine for people like me who like to write code.
Apache License 2.0
1.09k stars 222 forks source link

[OPTIONAL] Include guards #136

Closed WhoseTheNerd closed 6 years ago

WhoseTheNerd commented 6 years ago

It fixes errors like circular reference between headers and C1014. Makes executable file smaller.

Here's some links: https://en.wikipedia.org/wiki/Include_guard http://www.cplusplus.com/forum/general/71787/

riesinger commented 6 years ago

Sparky uses include guards (building sth. like Sparky would not be possible without it), can you elaborate on what you mean exactly?

WhoseTheNerd commented 6 years ago

I don't see include guards in SOURCE CODE of header file. Include guard is like: is this defined? if yes then don't include that, if no then include that.

KevinW1998 commented 6 years ago

It does use include guard. #pragma once basically does it, which you can find in every header.

WhoseTheNerd commented 6 years ago

Ok, i know that, but i meant '#ifndef SOUND_H \n #define SOUND_H \n "CODE" \n #endif'. My link to wikipedia explains this.