Skip to content

Commit

Permalink
[lumped builds] Add include guards (#pragma once) to header files tha…
Browse files Browse the repository at this point in the history
…t did not have any.

The codebase seems to use both “#pragma once“ approach, and “#ifndef / #define” approach,
so I picked pragma once as that one is less typing & less brittle.

When glslang is built with some other build system and lumped/unity builds are used,
without the include guards some headers would get included multiple times, leading to duplicate
declaration errors.
  • Loading branch information
aras-p committed May 10, 2017
1 parent 8e204b2 commit 23d3c71
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions SPIRV/GlslangToSpv.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
// ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
// POSSIBILITY OF SUCH DAMAGE.

#pragma once

#if _MSC_VER >= 1900
#pragma warning(disable : 4464) // relative include path contains '..'
#endif
Expand Down
2 changes: 2 additions & 0 deletions SPIRV/doc.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
// Parameterize the SPIR-V enumerants.
//

#pragma once

#include "spirv.hpp"

#include <vector>
Expand Down
2 changes: 2 additions & 0 deletions glslang/MachineIndependent/LiveTraverser.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#pragma once

#include "../Include/Common.h"
#include "reflection.h"
#include "localintermediate.h"
Expand Down
2 changes: 2 additions & 0 deletions glslang/MachineIndependent/RemoveTree.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@
// POSSIBILITY OF SUCH DAMAGE.
//

#pragma once

namespace glslang {

void RemoveAllTreeNodes(TIntermNode*);
Expand Down
2 changes: 2 additions & 0 deletions glslang/MachineIndependent/ScanContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
// sits between the preprocessor scanner and parser.
//

#pragma once

#include "ParseHelper.h"

namespace glslang {
Expand Down
2 changes: 2 additions & 0 deletions glslang/MachineIndependent/gl_types.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
** MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS.
*/

#pragma once

#define GL_FLOAT 0x1406
#define GL_FLOAT_VEC2 0x8B50
#define GL_FLOAT_VEC3 0x8B51
Expand Down
2 changes: 2 additions & 0 deletions glslang/MachineIndependent/propagateNoContraction.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@
// propagate 'noContraction' qualifier.
//

#pragma once

#include "../Include/intermediate.h"

namespace glslang {
Expand Down

0 comments on commit 23d3c71

Please sign in to comment.