summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndre Weissflog <floooh@gmail.com>2019-09-02 18:51:13 +0200
committerAndre Weissflog <floooh@gmail.com>2019-09-02 18:51:13 +0200
commit7eab3f1318556c0ba3123856289ade047a1bdd4e (patch)
tree4f218e334fde5a05c02553653e82c9f28911f415
parent089fa08e11e35dca8b84ecc07635c9753c807644 (diff)
replace pragma once with include guards in the util headers too (see #205 and #206)
-rw-r--r--util/sokol_fontstash.h3
-rw-r--r--util/sokol_gfx_imgui.h7
-rw-r--r--util/sokol_gl.h3
-rw-r--r--util/sokol_imgui.h3
4 files changed, 11 insertions, 5 deletions
diff --git a/util/sokol_fontstash.h b/util/sokol_fontstash.h
index b233fbe5..fe348fed 100644
--- a/util/sokol_fontstash.h
+++ b/util/sokol_fontstash.h
@@ -1,4 +1,4 @@
-#pragma once
+#ifndef SOKOL_FONTSTASH_INCLUDED
/*
sokol_fontstash.h -- renderer for https://github.com/memononen/fontstash
on top of sokol_gl.h
@@ -180,6 +180,7 @@ SOKOL_API_DECL uint32_t sfons_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
#ifdef __cplusplus
} /* extern "C" */
#endif
+#endif /* SOKOL_FONTSTASH_INCLUDED */
/*-- IMPLEMENTATION ----------------------------------------------------------*/
#ifdef SOKOL_FONTSTASH_IMPL
diff --git a/util/sokol_gfx_imgui.h b/util/sokol_gfx_imgui.h
index f551b284..3578cd60 100644
--- a/util/sokol_gfx_imgui.h
+++ b/util/sokol_gfx_imgui.h
@@ -1,4 +1,4 @@
-#pragma once
+#ifndef SOKOL_GFX_IMGUI_INCLUDED
/*
sokol_gfx_imgui.h -- debug-inspection UI for sokol_gfx.h using Dear ImGui
@@ -157,6 +157,7 @@
3. This notice may not be removed or altered from any source
distribution.
*/
+#define SOKOL_GFX_IMGUI_INCLUDED (1)
#include <stdint.h>
#include <stdbool.h>
@@ -583,9 +584,11 @@ SOKOL_API_DECL void sg_imgui_draw_capabilities_window(sg_imgui_t* ctx);
#if defined(__cplusplus)
} /* extern "C" */
#endif
+#endif /* SOKOL_GFX_IMGUI_INCLUDED */
/*=== IMPLEMENTATION =========================================================*/
-#if defined SOKOL_GFX_IMGUI_IMPL
+#ifdef SOKOL_GFX_IMGUI_IMPL
+#define SOKOL_GFX_IMGUI_IMPL_INCLUDED (1)
#if defined(__cplusplus)
#if !defined(IMGUI_VERSION)
#error "Please include imgui.h before the sokol_imgui.h implementation"
diff --git a/util/sokol_gl.h b/util/sokol_gl.h
index 45dbc6b8..0a46e64a 100644
--- a/util/sokol_gl.h
+++ b/util/sokol_gl.h
@@ -1,4 +1,4 @@
-#pragma once
+#ifndef SOKOL_GL_INCLUDED
/*
sokol_gl.h -- OpenGL 1.x style rendering on top of sokol_gfx.h
@@ -577,6 +577,7 @@ SOKOL_API_DECL void sgl_draw(void);
#ifdef __cplusplus
} /* extern "C" */
#endif
+#endif /* SOKOL_GL_INCLUDED */
/*-- IMPLEMENTATION ----------------------------------------------------------*/
#ifdef SOKOL_GL_IMPL
diff --git a/util/sokol_imgui.h b/util/sokol_imgui.h
index 93fb2a99..418dbe55 100644
--- a/util/sokol_imgui.h
+++ b/util/sokol_imgui.h
@@ -1,4 +1,4 @@
-#pragma once
+#ifndef SOKOL_IMGUI_INCLUDED
/*
sokol_imgui.h -- drop-in Dear ImGui renderer/event-handler for sokol_gfx.h
@@ -232,6 +232,7 @@ SOKOL_API_DECL void simgui_shutdown(void);
#ifdef __cplusplus
} /* extern "C" */
#endif
+#endif /* SOKOL_IMGUI_INCLUDED */
/*-- IMPLEMENTATION ----------------------------------------------------------*/
#ifdef SOKOL_IMGUI_IMPL