aboutsummaryrefslogtreecommitdiffstats
path: root/pugl
diff options
context:
space:
mode:
Diffstat (limited to 'pugl')
-rw-r--r--pugl/detail/implementation.h8
-rw-r--r--pugl/pugl.h12
-rw-r--r--pugl/pugl_cairo.h8
-rw-r--r--pugl/pugl_gl.h8
-rw-r--r--pugl/pugl_stub.h8
5 files changed, 16 insertions, 28 deletions
diff --git a/pugl/detail/implementation.h b/pugl/detail/implementation.h
index b1ff264..a6914fc 100644
--- a/pugl/detail/implementation.h
+++ b/pugl/detail/implementation.h
@@ -27,9 +27,7 @@
#include <stddef.h>
#include <stdint.h>
-#ifdef __cplusplus
-extern "C" {
-#endif
+PUGL_BEGIN_DECLS
/** Set `blob` to `data` with length `len`, reallocating if necessary. */
void puglSetBlob(PuglBlob* dest, const void* data, size_t len);
@@ -66,8 +64,6 @@ puglSetInternalClipboard(PuglView* view,
const void* data,
size_t len);
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+PUGL_END_DECLS
#endif // PUGL_DETAIL_IMPLEMENTATION_H
diff --git a/pugl/pugl.h b/pugl/pugl.h
index f926998..0bd8b47 100644
--- a/pugl/pugl.h
+++ b/pugl/pugl.h
@@ -43,9 +43,15 @@
#endif
#ifdef __cplusplus
-extern "C" {
+# define PUGL_BEGIN_DECLS extern "C" {
+# define PUGL_END_DECLS }
+#else
+# define PUGL_BEGIN_DECLS
+# define PUGL_END_DECLS
#endif
+PUGL_BEGIN_DECLS
+
/**
@defgroup pugl Pugl
Pugl C API.
@@ -1047,8 +1053,6 @@ puglProcessEvents(PuglView* view);
@}
*/
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+PUGL_END_DECLS
#endif /* PUGL_PUGL_H */
diff --git a/pugl/pugl_cairo.h b/pugl/pugl_cairo.h
index 34c82c9..c289c16 100644
--- a/pugl/pugl_cairo.h
+++ b/pugl/pugl_cairo.h
@@ -23,9 +23,7 @@
#include "pugl/pugl.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+PUGL_BEGIN_DECLS
/**
@defgroup cairo Cairo
@@ -46,8 +44,6 @@ puglCairoBackend(void);
@}
*/
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+PUGL_END_DECLS
#endif // PUGL_PUGL_CAIRO_H
diff --git a/pugl/pugl_gl.h b/pugl/pugl_gl.h
index a13cba2..7031013 100644
--- a/pugl/pugl_gl.h
+++ b/pugl/pugl_gl.h
@@ -23,9 +23,7 @@
#include "pugl/pugl.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+PUGL_BEGIN_DECLS
/**
@defgroup gl OpenGL
@@ -53,9 +51,7 @@ puglGetProcAddress(const char* name);
PUGL_API const PuglBackend*
puglGlBackend(void);
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+PUGL_END_DECLS
/**
@}
diff --git a/pugl/pugl_stub.h b/pugl/pugl_stub.h
index 3ecc2b4..a99eb4a 100644
--- a/pugl/pugl_stub.h
+++ b/pugl/pugl_stub.h
@@ -23,9 +23,7 @@
#include "pugl/pugl.h"
-#ifdef __cplusplus
-extern "C" {
-#endif
+PUGL_BEGIN_DECLS
/**
@defgroup stub Stub
@@ -109,8 +107,6 @@ puglStubGetContext(PuglView* view)
@}
*/
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+PUGL_END_DECLS
#endif // PUGL_PUGL_STUB_H