Skip to content

Commit 781f787

Browse files
jturner65aclegg3
andauthored
--[BugFix] Add missing header guard; Change pragma once to #-defines (#806)
* --Add missing header guard; Change pragma once to #-defines * Update src/esp/gfx/DepthUnprojection.h Co-authored-by: Alexander Clegg <[email protected]> * Update src/esp/gfx/LightSetup.h Co-authored-by: Alexander Clegg <[email protected]> * Update src/esp/gfx/MeshVisualizerDrawable.h Co-authored-by: Alexander Clegg <[email protected]> * Update src/esp/gfx/PTexMeshDrawable.h Co-authored-by: Alexander Clegg <[email protected]> * --Update guards Co-authored-by: Alexander Clegg <[email protected]>
1 parent 32e24fe commit 781f787

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+248
-64
lines changed

Diff for: src/esp/agent/Agent.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
// Copyright (c) Facebook, Inc. and its affiliates.
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
4-
5-
#pragma once
4+
#ifndef ESP_AGENT_AGENT_H_
5+
#define ESP_AGENT_AGENT_H_
66

77
#include <map>
88
#include <set>
@@ -143,3 +143,5 @@ class Agent : public Magnum::SceneGraph::AbstractFeature3D {
143143

144144
} // namespace agent
145145
} // namespace esp
146+
147+
#endif // ESP_AGENT_AGENT_H_

Diff for: src/esp/assets/Asset.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_ASSET_H_
6+
#define ESP_ASSETS_ASSET_H_
67

78
#include "esp/core/esp.h"
89
#include "esp/geo/CoordinateFrame.h"
@@ -65,3 +66,5 @@ struct Asset {
6566

6667
} // namespace assets
6768
} // namespace esp
69+
70+
#endif // ESP_ASSETS_ASSET_H_

Diff for: src/esp/assets/CollisionMeshData.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_COLLISIONMESHDATA_H_
6+
#define ESP_ASSETS_COLLISIONMESHDATA_H_
67

78
/** @file
89
* @brief Struct @ref esp::assets::CollisionMeshData
@@ -52,3 +53,5 @@ struct CollisionMeshData {
5253

5354
} // namespace assets
5455
} // namespace esp
56+
57+
#endif // ESP_ASSETS_COLLISIONMESHDATA_H_

Diff for: src/esp/assets/GenericInstanceMeshData.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_GENERICINSTANCEMESHDATA_H_
6+
#define ESP_ASSETS_GENERICINSTANCEMESHDATA_H_
67

78
#include <Corrade/Containers/Optional.h>
89
#include <Magnum/GL/Buffer.h>
@@ -99,3 +100,5 @@ class GenericInstanceMeshData : public BaseMesh {
99100

100101
} // namespace assets
101102
} // namespace esp
103+
104+
#endif // ESP_ASSETS_GENERICINSTANCEMESHDATA_H_

Diff for: src/esp/assets/GenericMeshData.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_GENERICMESHDATA_H_
6+
#define ESP_ASSETS_GENERICMESHDATA_H_
67

78
/** @file
89
* @brief Class @ref esp::assets::GenericMeshData, Class @ref
@@ -114,3 +115,5 @@ class GenericMeshData : public BaseMesh {
114115
};
115116
} // namespace assets
116117
} // namespace esp
118+
119+
#endif // ESP_ASSETS_GENERICMESHDATA_H_

Diff for: src/esp/assets/MeshData.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
// Copyright (c) Facebook, Inc. and its affiliates.
22
// This source code is licensed under the MIT license found in the
3-
// LICENSE file in the root directory of this source tree.
3+
// LICENSE file in the root directory of this source tree.\
44
5-
#pragma once
5+
#ifndef ESP_ASSETS_MESHDATA_H_
6+
#define ESP_ASSETS_MESHDATA_H_
67

78
#include <vector>
89

@@ -29,3 +30,5 @@ struct MeshData {
2930

3031
} // namespace assets
3132
} // namespace esp
33+
34+
#endif // ESP_ASSETS_MESHDATA_H_

Diff for: src/esp/assets/MeshMetaData.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_MESHMETADATA_H_
6+
#define ESP_ASSETS_MESHMETADATA_H_
67

78
/** @file
89
* @brief Struct @ref esp::assets::MeshTransformNode, Struct @ref
@@ -141,3 +142,5 @@ struct MeshMetaData {
141142

142143
} // namespace assets
143144
} // namespace esp
145+
146+
#endif // ESP_ASSETS_MESHMETADATA_H_

Diff for: src/esp/assets/Mp3dInstanceMeshData.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_MP3DINSTANCEDATA_H_
6+
#define ESP_ASSETS_MP3DINSTANCEDATA_H_
67

78
#include <Magnum/GL/Buffer.h>
89
#include <Magnum/GL/Mesh.h>
@@ -45,3 +46,5 @@ class Mp3dInstanceMeshData : public GenericInstanceMeshData {
4546

4647
} // namespace assets
4748
} // namespace esp
49+
50+
#endif // ESP_ASSETS_MP3DINSTANCEDATA_H_

Diff for: src/esp/assets/PTexMeshData.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_ASSETS_PTEXMESHDATA_H_
6+
#define ESP_ASSETS_PTEXMESHDATA_H_
67

78
#include <memory>
89
#include <string>
@@ -101,3 +102,5 @@ class PTexMeshData : public BaseMesh {
101102

102103
} // namespace assets
103104
} // namespace esp
105+
106+
#endif // ESP_ASSETS_PTEXMESHDATA_H_

Diff for: src/esp/bindings/bindings.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_BINDINGS_BINDINGS_H_
6+
#define ESP_BINDINGS_BINDINGS_H_
67

78
#include <pybind11/pybind11.h>
89
#include "esp/bindings/OpaqueTypes.h"
@@ -45,3 +46,5 @@ void initSimBindings(pybind11::module& m);
4546
}
4647

4748
} // namespace esp
49+
50+
#endif // ESP_BINDINGS_BINDINGS_H_

Diff for: src/esp/core/Buffer.h

+5-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_BUFFER_H_
6+
#define ESP_CORE_BUFFER_H_
7+
68
#include <Corrade/Containers/Array.h>
79

810
#include "esp/core/esp.h"
@@ -51,3 +53,5 @@ class Buffer {
5153

5254
} // namespace core
5355
} // namespace esp
56+
57+
#endif // ESP_CORE_BUFFER_H_

Diff for: src/esp/core/Configuration.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_CONFIGURATION_H_
6+
#define ESP_CORE_CONFIGURATION_H_
67

78
#include <Corrade/Utility/Configuration.h>
89
#include <Magnum/Magnum.h>
@@ -111,3 +112,5 @@ class Configuration {
111112

112113
} // namespace core
113114
} // namespace esp
115+
116+
#endif // ESP_CORE_CONFIGURATION_H_

Diff for: src/esp/core/RigidState.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_RIGIDSTATE_H_
6+
#define ESP_CORE_RIGIDSTATE_H_
67

78
#include <Magnum/Magnum.h>
89
#include <Magnum/Math/Quaternion.h>
@@ -28,3 +29,5 @@ struct RigidState {
2829
};
2930
} // namespace core
3031
} // namespace esp
32+
33+
#endif // ESP_CORE_RIGIDSTATE_H_

Diff for: src/esp/core/Utility.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_UTILITY_H_
6+
#define ESP_CORE_UTILITY_H_
67

78
/** @file */
89

@@ -34,3 +35,5 @@ Magnum::Quaternion randomRotation() {
3435
}
3536
} // namespace core
3637
} // namespace esp
38+
39+
#endif // ESP_CORE_UTILITY_H_

Diff for: src/esp/core/esp.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_ESP_H_
6+
#define ESP_CORE_ESP_H_
67

78
/** @file */
89

@@ -173,3 +174,5 @@ inline bool equal(const std::map<K, std::shared_ptr<V>>& a,
173174
}
174175

175176
} // namespace esp
177+
178+
#endif // ESP_CORE_ESP_H_

Diff for: src/esp/core/logging.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_LOGGING_H_
6+
#define ESP_CORE_LOGGING_H_
67

78
#include "esp/core/configure.h"
89

@@ -66,3 +67,5 @@ class LogMessageVoidify {
6667
exit(-1); \
6768
} \
6869
} while (false)
70+
71+
#endif // ESP_CORE_LOGGING_H_

Diff for: src/esp/core/random.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_CORE_RANDOM_H_
6+
#define ESP_CORE_RANDOM_H_
67

78
#include <random>
89

@@ -60,3 +61,5 @@ class Random {
6061

6162
} // namespace core
6263
} // namespace esp
64+
65+
#endif // ESP_CORE_RANDOM_H_

Diff for: src/esp/core/spimpl.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
- Released
2626
*/
2727

28-
#ifndef SPIMPL_H_
29-
#define SPIMPL_H_
28+
#ifndef ESP_CORE_SPIMPL_H_
29+
#define ESP_CORE_SPIMPL_H_
3030

3131
#include <cassert>
3232
#include <memory>
@@ -440,4 +440,4 @@ struct hash<spimpl::impl_ptr<T, D, C>> {
440440
};
441441
} // namespace std
442442

443-
#endif // SPIMPL_H_
443+
#endif // ESP_CORE_SPIMPL_H_

Diff for: src/esp/geo/OBB.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_GEO_OBB_H_
6+
#define ESP_GEO_OBB_H_
67

78
#include "esp/core/esp.h"
89
#include "esp/geo/geo.h"
@@ -76,3 +77,5 @@ OBB computeGravityAlignedMOBB(const vec3f& gravity,
7677

7778
} // namespace geo
7879
} // namespace esp
80+
81+
#endif // ESP_GEO_OBB_H_

Diff for: src/esp/geo/geo.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_GEO_GEO_H_
6+
#define ESP_GEO_GEO_H_
67

78
#include <vector>
89

@@ -61,3 +62,5 @@ struct Ray {
6162

6263
} // namespace geo
6364
} // namespace esp
65+
66+
#endif // ESP_GEO_GEO_H_

Diff for: src/esp/gfx/DepthUnprojection.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_GFX_DEPTHUNPROJECTION_H_
6+
#define ESP_GFX_DEPTHUNPROJECTION_H_
67

78
#include <Corrade/Containers/EnumSet.h>
89
#include <Magnum/GL/AbstractShaderProgram.h>
@@ -152,3 +153,5 @@ void unprojectDepth(const Magnum::Vector2& unprojection,
152153

153154
} // namespace gfx
154155
} // namespace esp
156+
157+
#endif // ESP_GFX_DEPTHUNPROJECTION_H_

Diff for: src/esp/gfx/Drawable.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_GFX_DRAWABLE_H_
6+
#define ESP_GFX_DRAWABLE_H_
67

78
#include "esp/core/esp.h"
89
#include "magnum.h"
@@ -87,3 +88,5 @@ class Drawable : public Magnum::SceneGraph::Drawable3D {
8788

8889
} // namespace gfx
8990
} // namespace esp
91+
92+
#endif // ESP_GFX_DRAWABLE_H_

Diff for: src/esp/gfx/DrawableGroup.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_GFX_DRAWABLEGROUP_H_
6+
#define ESP_GFX_DRAWABLEGROUP_H_
67

78
#include <Magnum/SceneGraph/Drawable.h>
89
#include <Magnum/SceneGraph/FeatureGroup.h>
@@ -91,3 +92,5 @@ class DrawableGroup : public Magnum::SceneGraph::DrawableGroup3D {
9192

9293
} // namespace gfx
9394
} // namespace esp
95+
96+
#endif // ESP_GFX_DRAWABLEGROUP_H_

Diff for: src/esp/gfx/GenericDrawable.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22
// This source code is licensed under the MIT license found in the
33
// LICENSE file in the root directory of this source tree.
44

5-
#pragma once
5+
#ifndef ESP_GFX_GENERICDRAWABLE_H_
6+
#define ESP_GFX_GENERICDRAWABLE_H_
67

78
#include <Magnum/Shaders/Phong.h>
89

@@ -49,3 +50,5 @@ class GenericDrawable : public Drawable {
4950

5051
} // namespace gfx
5152
} // namespace esp
53+
54+
#endif // ESP_GFX_GENERICDRAWABLE_H_

0 commit comments

Comments
 (0)