Skip to content

Commit

Permalink
Add missing include guards
Browse files Browse the repository at this point in the history
  • Loading branch information
drobilla committed Oct 21, 2020
1 parent 063ddc8 commit feb6c4f
Show file tree
Hide file tree
Showing 10 changed files with 48 additions and 3 deletions.
5 changes: 5 additions & 0 deletions examples/cube_view.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef EXAMPLES_CUBE_VIEW_H
#define EXAMPLES_CUBE_VIEW_H

#define GL_SILENCE_DEPRECATION 1

#include "demo_utils.h"
Expand Down Expand Up @@ -129,3 +132,5 @@ displayCube(PuglView* const view,
glDrawArrays(GL_LINES, 0, 8);
glDisableClientState(GL_VERTEX_ARRAY);
}

#endif // EXAMPLES_CUBE_VIEW_H
6 changes: 3 additions & 3 deletions examples/demo_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef PUGL_DEMO_UTILS_H
#define PUGL_DEMO_UTILS_H
#ifndef EXAMPLES_DEMO_UTILS_H
#define EXAMPLES_DEMO_UTILS_H

#include "pugl/pugl.h"

Expand Down Expand Up @@ -123,4 +123,4 @@ puglPrintFps(const PuglWorld* world,
}
}

#endif // PUGL_DEMO_UTILS_H
#endif // EXAMPLES_DEMO_UTILS_H
5 changes: 5 additions & 0 deletions examples/rects.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
many 2D rectangles.
*/

#ifndef EXAMPLES_RECTS_H
#define EXAMPLES_RECTS_H

#include <math.h>
#include <stddef.h>

Expand Down Expand Up @@ -80,3 +83,5 @@ moveRect(Rect* const rect,
(cosf((float)time * rect->size[1] / 64.0f + normal) + 1.0f) /
2.0f;
}

#endif // EXAMPLES_RECTS_H
5 changes: 5 additions & 0 deletions examples/shader_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef EXAMPLES_SHADER_UTILS_H
#define EXAMPLES_SHADER_UTILS_H

#include "glad/glad.h"

#include <stdio.h>
Expand Down Expand Up @@ -100,3 +103,5 @@ compileProgram(const char* headerSource,

return program;
}

#endif // EXAMPLES_SHADER_UTILS_H
5 changes: 5 additions & 0 deletions include/pugl/detail/mac.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@
@brief Shared definitions for MacOS implementation.
*/

#ifndef PUGL_DETAIL_MAC_H
#define PUGL_DETAIL_MAC_H

#include "pugl/pugl.h"

#import <Cocoa/Cocoa.h>
Expand Down Expand Up @@ -53,3 +56,5 @@ struct PuglInternalsImpl {
uint32_t mods;
bool mouseTracked;
};

#endif // PUGL_DETAIL_MAC_H
5 changes: 5 additions & 0 deletions include/pugl/detail/win.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
@brief Shared definitions for Windows implementation.
*/

#ifndef PUGL_DETAIL_WIN_H
#define PUGL_DETAIL_WIN_H

#include "pugl/detail/implementation.h"

#include <windows.h>
Expand Down Expand Up @@ -145,3 +148,5 @@ puglWinStubEnter(PuglView* view, const PuglEventExpose* expose);

PuglStatus
puglWinStubLeave(PuglView* view, const PuglEventExpose* expose);

#endif // PUGL_DETAIL_WIN_H
5 changes: 5 additions & 0 deletions include/pugl/detail/x11.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
@brief Shared definitions for X11 implementation.
*/

#ifndef PUGL_DETAIL_X11_H
#define PUGL_DETAIL_X11_H

#include "pugl/detail/types.h"
#include "pugl/pugl.h"

Expand Down Expand Up @@ -74,3 +77,5 @@ struct PuglInternalsImpl {
};

PuglStatus puglX11StubConfigure(PuglView* view);

#endif // PUGL_DETAIL_X11_H
5 changes: 5 additions & 0 deletions include/pugl/gl.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
pure portable programs.
*/

#ifndef PUGL_GL_H
#define PUGL_GL_H

// IWYU pragma: begin_exports

#ifdef __APPLE__
Expand All @@ -34,3 +37,5 @@
#endif

// IWYU pragma: end_exports

#endif // PUGL_GL_H
5 changes: 5 additions & 0 deletions include/pugl/glu.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@
pure portable programs.
*/

#ifndef PUGL_GLU_H
#define PUGL_GLU_H

// IWYU pragma: begin_exports

#ifdef __APPLE__
Expand All @@ -34,3 +37,5 @@
#endif

// IWYU pragma: end_exports

#endif // PUGL_GLU_H
5 changes: 5 additions & 0 deletions test/test_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

#ifndef TEST_TEST_UTILS_H
#define TEST_TEST_UTILS_H

#define __STDC_FORMAT_MACROS 1

#include "pugl/pugl.h"
Expand Down Expand Up @@ -345,3 +348,5 @@ puglParseTestOptions(int* pargc, char*** pargv)

return opts;
}

#endif // TEST_TEST_UTILS_H

0 comments on commit feb6c4f

Please sign in to comment.