summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorYaron Cohen-Tal <yaronct@gmail.com>2015-07-19 12:59:31 +0300
committerYaron Cohen-Tal <yaronct@gmail.com>2015-07-19 13:40:35 +0300
commit90c6158d61a4b27f00997049d67344b425275c5c (patch)
tree65366dd2d858c408b4087cca9470f1551d671240 /include
parent773dd02f596b3f256bb1c0f65ac091db93a9518b (diff)
downloadlibepoxy-90c6158d61a4b27f00997049d67344b425275c5c.tar.gz
Unite defenitions "PUBLIC" and "EPOXY_IMPORTEXPORT" and add it where appropriate. Fix tests build errors.
Diffstat (limited to 'include')
-rw-r--r--include/epoxy/common.h62
-rw-r--r--include/epoxy/egl.h9
-rw-r--r--include/epoxy/gl.h10
-rw-r--r--include/epoxy/glx.h12
-rw-r--r--include/epoxy/wgl.h7
5 files changed, 80 insertions, 20 deletions
diff --git a/include/epoxy/common.h b/include/epoxy/common.h
new file mode 100644
index 0000000..e00a011
--- /dev/null
+++ b/include/epoxy/common.h
@@ -0,0 +1,62 @@
+/*
+ * Copyright © 2013 Intel Corporation
+ *
+ * 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
+ *
+ * Provides basic definitions for Epoxy. Included by all other Epoxy files.
+ */
+
+#ifndef EPOXY_COMMON_H
+#define EPOXY_COMMON_H
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#if defined _WIN32 || defined __CYGWIN__
+ #ifdef EPOXY_EXPORTS
+ #ifdef __GNUC__
+ #define EPOXY_IMPORTEXPORT __attribute__ ((dllexport))
+ #else
+ #define EPOXY_IMPORTEXPORT __declspec(dllexport)
+ #endif
+ #else
+ #ifdef __GNUC__
+ #define EPOXY_IMPORTEXPORT __attribute__ ((dllimport))
+ #else
+ #define EPOXY_IMPORTEXPORT __declspec(dllimport)
+ #endif
+ #endif
+#else
+ #if __GNUC__ >= 4
+ #define EPOXY_IMPORTEXPORT __attribute__ ((visibility ("default")))
+ #else
+ #define EPOXY_IMPORTEXPORT
+ #endif
+#endif
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /* EPOXY_COMMON_H */
diff --git a/include/epoxy/egl.h b/include/epoxy/egl.h
index bd02948..ae54929 100644
--- a/include/epoxy/egl.h
+++ b/include/epoxy/egl.h
@@ -30,12 +30,13 @@
#ifndef EPOXY_EGL_H
#define EPOXY_EGL_H
+#include <epoxy/common.h>
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdbool.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,8 +46,8 @@ extern "C" {
#include "epoxy/egl_generated.h"
-PUBLIC bool epoxy_has_egl_extension(EGLDisplay dpy, const char *extension);
-PUBLIC int epoxy_egl_version(EGLDisplay dpy);
+EPOXY_IMPORTEXPORT bool epoxy_has_egl_extension(EGLDisplay dpy, const char *extension);
+EPOXY_IMPORTEXPORT int epoxy_egl_version(EGLDisplay dpy);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/include/epoxy/gl.h b/include/epoxy/gl.h
index 0be3a66..d150da4 100644
--- a/include/epoxy/gl.h
+++ b/include/epoxy/gl.h
@@ -30,12 +30,13 @@
#ifndef EPOXY_GL_H
#define EPOXY_GL_H
+#include <epoxy/common.h>
+#include <stdbool.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdbool.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 +52,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 +70,6 @@ extern "C" {
#define EPOXY_CALLSPEC __stdcall
#endif
-#ifndef EPOXY_IMPORTEXPORT
-#define EPOXY_IMPORTEXPORT __declspec(dllimport)
-#endif
-
#ifndef GLAPI
#define GLAPI extern
#endif
diff --git a/include/epoxy/glx.h b/include/epoxy/glx.h
index 36fc617..5efe931 100644
--- a/include/epoxy/glx.h
+++ b/include/epoxy/glx.h
@@ -30,15 +30,15 @@
#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>
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#if defined(GLX_H) || defined(__glxext_h_)
#error epoxy/glx.h must be included before (or in place of) GL/glx.h
#else
@@ -48,8 +48,8 @@ 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_IMPORTEXPORT bool epoxy_has_glx_extension(Display *dpy, int screen, const char *extension);
+EPOXY_IMPORTEXPORT int epoxy_glx_version(Display *dpy, int screen);
#ifdef __cplusplus
} /* extern "C" */
diff --git a/include/epoxy/wgl.h b/include/epoxy/wgl.h
index fdd7b4f..9ab74f8 100644
--- a/include/epoxy/wgl.h
+++ b/include/epoxy/wgl.h
@@ -30,13 +30,14 @@
#ifndef EPOXY_WGL_H
#define EPOXY_WGL_H
+#include <epoxy/common.h>
+#include <stdbool.h>
+#include <windows.h>
+
#ifdef __cplusplus
extern "C" {
#endif
-#include <stdbool.h>
-#include <windows.h>
-
#undef wglUseFontBitmaps
#undef wglUseFontOutlines