summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2017-01-31 18:09:34 +0000
committerEmmanuele Bassi <ebassi@gnome.org>2017-01-31 18:09:34 +0000
commit5bcc550a6c85e7db4a8564aa292113e32d9993f0 (patch)
tree5e7dc60946fa48695e7b415a276bd31a1405ad86 /include
parent39a10ca79b58dc768ce037f4db9e347ee74e277f (diff)
parent7a06803465dd07e152de1b30763d6bea0d3fcc93 (diff)
downloadlibepoxy-5bcc550a6c85e7db4a8564aa292113e32d9993f0.tar.gz
Merge branch 'symbol-visibility'
Diffstat (limited to 'include')
-rw-r--r--include/epoxy/Makefile.am1
-rw-r--r--include/epoxy/common.h44
-rw-r--r--include/epoxy/egl.h16
-rw-r--r--include/epoxy/gl.h23
-rw-r--r--include/epoxy/glx.h14
-rw-r--r--include/epoxy/meson.build4
-rw-r--r--include/epoxy/wgl.h16
7 files changed, 75 insertions, 43 deletions
diff --git a/include/epoxy/Makefile.am b/include/epoxy/Makefile.am
index b5b94a6..494c96e 100644
--- a/include/epoxy/Makefile.am
+++ b/include/epoxy/Makefile.am
@@ -22,6 +22,7 @@
epoxyincludedir = $(includedir)/epoxy
epoxyinclude_HEADERS = \
+ common.h \
gl.h \
$(EGL_INCLUDES) \
$(GLX_INCLUDES) \
diff --git a/include/epoxy/common.h b/include/epoxy/common.h
new file mode 100644
index 0000000..a745f16
--- /dev/null
+++ b/include/epoxy/common.h
@@ -0,0 +1,44 @@
+/*
+ * Copyright 2017 Emmanuele Bassi
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ */
+
+/** @file common.h
+ *
+ * A common header file, used to define macros and shared symbols.
+ */
+
+#ifndef EPOXY_COMMON_H
+#define EPOXY_COMMON_H
+
+#ifdef __cplusplus
+# define EPOXY_BEGIN_DECLS extern "C" {
+# define EPOXY_END_DECLS }
+#else
+# define EPOXY_BEGIN_DECLS
+# define EPOXY_END_DECLS
+#endif
+
+#ifndef EPOXY_PUBLIC
+# define EPOXY_PUBLIC extern
+#endif
+
+#endif /* EPOXY_COMMON_H */
diff --git a/include/epoxy/egl.h b/include/epoxy/egl.h
index f1c3f56..79e9bb4 100644
--- a/include/epoxy/egl.h
+++ b/include/epoxy/egl.h
@@ -30,12 +30,10 @@
#ifndef EPOXY_EGL_H
#define EPOXY_EGL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
+#include "epoxy/common.h"
+
#if defined(__egl_h_) || defined(__eglext_h_)
#error epoxy/egl.h must be included before (or in place of) GL/egl.h
#else
@@ -45,11 +43,11 @@ extern "C" {
#include "epoxy/egl_generated.h"
-bool epoxy_has_egl_extension(EGLDisplay dpy, const char *extension);
-int epoxy_egl_version(EGLDisplay dpy);
+EPOXY_BEGIN_DECLS
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+EPOXY_PUBLIC bool epoxy_has_egl_extension(EGLDisplay dpy, const char *extension);
+EPOXY_PUBLIC int epoxy_egl_version(EGLDisplay dpy);
+
+EPOXY_END_DECLS
#endif /* EPOXY_EGL_H */
diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h
index 0be3a66..425431c 100644
--- a/include/epoxy/gl.h
+++ b/include/epoxy/gl.h
@@ -30,12 +30,10 @@
#ifndef EPOXY_GL_H
#define EPOXY_GL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
+#include "epoxy/common.h"
+
#if defined(__gl_h_) || defined(__glext_h_)
#error epoxy/gl.h must be included before (or in place of) GL/gl.h
#else
@@ -51,7 +49,6 @@ extern "C" {
/* APIENTRY and GLAPIENTRY are not used on Linux or Mac. */
#define APIENTRY
#define GLAPIENTRY
-#define EPOXY_IMPORTEXPORT
#define EPOXY_CALLSPEC
#define GLAPI
#define KHRONOS_APIENTRY
@@ -70,10 +67,6 @@ extern "C" {
#define EPOXY_CALLSPEC __stdcall
#endif
-#ifndef EPOXY_IMPORTEXPORT
-#define EPOXY_IMPORTEXPORT __declspec(dllimport)
-#endif
-
#ifndef GLAPI
#define GLAPI extern
#endif
@@ -93,12 +86,12 @@ extern "C" {
#include "epoxy/gl_generated.h"
-EPOXY_IMPORTEXPORT bool epoxy_has_gl_extension(const char *extension);
-EPOXY_IMPORTEXPORT bool epoxy_is_desktop_gl(void);
-EPOXY_IMPORTEXPORT int epoxy_gl_version(void);
+EPOXY_BEGIN_DECLS
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+EPOXY_PUBLIC bool epoxy_has_gl_extension(const char *extension);
+EPOXY_PUBLIC bool epoxy_is_desktop_gl(void);
+EPOXY_PUBLIC int epoxy_gl_version(void);
+
+EPOXY_END_DECLS
#endif /* EPOXY_GL_H */
diff --git a/include/epoxy/glx.h b/include/epoxy/glx.h
index 8df33b8..a67cb07 100644
--- a/include/epoxy/glx.h
+++ b/include/epoxy/glx.h
@@ -30,10 +30,6 @@
#ifndef EPOXY_GLX_H
#define EPOXY_GLX_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <epoxy/gl.h>
#include <X11/Xlib.h>
#include <X11/Xutil.h>
@@ -49,11 +45,11 @@ extern "C" {
#include "epoxy/glx_generated.h"
-bool epoxy_has_glx_extension(Display *dpy, int screen, const char *extension);
-int epoxy_glx_version(Display *dpy, int screen);
+EPOXY_BEGIN_DECLS
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+EPOXY_PUBLIC bool epoxy_has_glx_extension(Display *dpy, int screen, const char *extension);
+EPOXY_PUBLIC int epoxy_glx_version(Display *dpy, int screen);
+
+EPOXY_END_DECLS
#endif /* EPOXY_GLX_H */
diff --git a/include/epoxy/meson.build b/include/epoxy/meson.build
index 545e991..809b92c 100644
--- a/include/epoxy/meson.build
+++ b/include/epoxy/meson.build
@@ -1,3 +1,5 @@
+headers = [ 'common.h' ]
+
gl_generated = custom_target('gl_generated.h',
input: gl_registry,
output: [
@@ -15,7 +17,7 @@ gl_generated = custom_target('gl_generated.h',
install_dir: join_paths(epoxy_includedir, 'epoxy'))
gen_headers = [ gl_generated ]
-headers = [ 'gl.h', ]
+headers += [ 'gl.h', ]
if build_egl
egl_generated = custom_target('egl_generated.h',
diff --git a/include/epoxy/wgl.h b/include/epoxy/wgl.h
index fdd7b4f..84d26ac 100644
--- a/include/epoxy/wgl.h
+++ b/include/epoxy/wgl.h
@@ -30,13 +30,11 @@
#ifndef EPOXY_WGL_H
#define EPOXY_WGL_H
-#ifdef __cplusplus
-extern "C" {
-#endif
-
#include <stdbool.h>
#include <windows.h>
+#include "epoxy/common.h"
+
#undef wglUseFontBitmaps
#undef wglUseFontOutlines
@@ -54,11 +52,11 @@ extern "C" {
#include "epoxy/wgl_generated.h"
-EPOXY_IMPORTEXPORT bool epoxy_has_wgl_extension(HDC hdc, const char *extension);
-EPOXY_IMPORTEXPORT void epoxy_handle_external_wglMakeCurrent(void);
+EPOXY_BEGIN_DECLS
-#ifdef __cplusplus
-} /* extern "C" */
-#endif
+EPOXY_PUBLIC bool epoxy_has_wgl_extension(HDC hdc, const char *extension);
+EPOXY_PUBLIC void epoxy_handle_external_wglMakeCurrent(void);
+
+EPOXY_END_DECLS
#endif /* EPOXY_WGL_H */