summaryrefslogtreecommitdiff
path: root/src
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 /src
parent773dd02f596b3f256bb1c0f65ac091db93a9518b (diff)
downloadlibepoxy-90c6158d61a4b27f00997049d67344b425275c5c.tar.gz
Unite defenitions "PUBLIC" and "EPOXY_IMPORTEXPORT" and add it where appropriate. Fix tests build errors.
Diffstat (limited to 'src')
-rw-r--r--src/Makefile.am1
-rw-r--r--src/Makefile.vc2
-rw-r--r--src/dispatch_common.c10
-rw-r--r--src/dispatch_common.h14
-rw-r--r--src/dispatch_egl.c4
-rw-r--r--src/dispatch_glx.c4
-rw-r--r--src/dispatch_wgl.c12
-rwxr-xr-xsrc/gen_dispatch.py2
8 files changed, 18 insertions, 31 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 49c3507..9c3229b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -29,6 +29,7 @@ AM_CFLAGS = \
$(VISIBILITY_CFLAGS) \
$(X11_CFLAGS) \
$(EGL_CFLAGS) \
+ -DEPOXY_EXPORTS \
$()
epoxyincludedir = $(includedir)/epoxy
diff --git a/src/Makefile.vc b/src/Makefile.vc
index a111bab..7b71f13 100644
--- a/src/Makefile.vc
+++ b/src/Makefile.vc
@@ -46,7 +46,7 @@ EPOXY_DLL_BASENAME = $(EPOXY_BASENAME)-vs$(VSVER)
all: $(EPOXY_DLL_BASENAME).dll
$(EPOXY_DLL_BASENAME).dll: ../$(GL_GEN_HEADER) ../$(WGL_GEN_HEADER) ../$(EGL_GEN_HEADER) $(GENERATED_GL_SOURCE) $(GENERATED_WGL_SOURCE) $(GENERATED_EGL_SOURCE) $(EPOXY_C_SRC) $(EPOXY_WGL_C_SRC) $(EPOXY_EGL_C_SRC)
- $(CC) $(CFLAGS_ADD) $(CFLAGS_C99_COMPAT) $(EPOXY_C_SRC) $(EPOXY_WGL_C_SRC) $(EPOXY_EGL_C_SRC) $(GENERATED_GL_SOURCE) $(GENERATED_WGL_SOURCE) $(GENERATED_EGL_SOURCE) /I c:\opt\Imagination-3_5\PowerVR_Graphics\PowerVR_SDK\SDK_3.5\Builds\Include \
+ $(CC) $(CFLAGS_ADD) $(CFLAGS_C99_COMPAT) $(EPOXY_C_SRC) $(EPOXY_WGL_C_SRC) $(EPOXY_EGL_C_SRC) $(GENERATED_GL_SOURCE) $(GENERATED_WGL_SOURCE) $(GENERATED_EGL_SOURCE) /DEPOXY_EXPORTS \
/link /DLL /DEBUG $(EXTRA_LDFLAGS) /pdb:$(EPOXY_DLL_BASENAME).pdb /out:$@ /implib:$(EPOXY_BASENAME).lib
@if exist $@.manifest mt /manifest $@.manifest /outputresource:$@;2
diff --git a/src/dispatch_common.c b/src/dispatch_common.c
index 013027f..f6fbd9f 100644
--- a/src/dispatch_common.c
+++ b/src/dispatch_common.c
@@ -265,7 +265,7 @@ do_dlsym(void **handle, const char *lib_name, const char *name,
return result;
}
-PUBLIC bool
+EPOXY_IMPORTEXPORT bool
epoxy_is_desktop_gl(void)
{
const char *es_prefix = "OpenGL ES";
@@ -329,7 +329,7 @@ epoxy_internal_gl_version(int error_version)
return 10 * major + minor;
}
-PUBLIC int
+EPOXY_IMPORTEXPORT int
epoxy_gl_version(void)
{
return epoxy_internal_gl_version(0);
@@ -452,7 +452,7 @@ epoxy_current_context_is_glx(void)
* \sa epoxy_has_egl_extension()
* \sa epoxy_has_glx_extension()
*/
-PUBLIC bool
+EPOXY_IMPORTEXPORT bool
epoxy_has_gl_extension(const char *ext)
{
return epoxy_internal_has_gl_extension(ext, false);
@@ -703,5 +703,5 @@ WRAPPER(epoxy_glEnd)(void)
#endif
}
-PUBLIC PFNGLBEGINPROC epoxy_glBegin = epoxy_glBegin_wrapped;
-PUBLIC PFNGLENDPROC epoxy_glEnd = epoxy_glEnd_wrapped;
+EPOXY_IMPORTEXPORT PFNGLBEGINPROC epoxy_glBegin = epoxy_glBegin_wrapped;
+EPOXY_IMPORTEXPORT PFNGLENDPROC epoxy_glEnd = epoxy_glEnd_wrapped;
diff --git a/src/dispatch_common.h b/src/dispatch_common.h
index 161fe07..c32815a 100644
--- a/src/dispatch_common.h
+++ b/src/dispatch_common.h
@@ -27,32 +27,18 @@
#define PLATFORM_HAS_EGL 1
#define PLATFORM_HAS_GLX 0
#define PLATFORM_HAS_WGL 1
-#define EPOXY_IMPORTEXPORT __declspec(dllexport)
#elif defined(__APPLE__)
#define PLATFORM_HAS_EGL 0
#define PLATFORM_HAS_GLX 0
#define PLATFORM_HAS_WGL 0
-#define EPOXY_IMPORTEXPORT
#elif defined(ANDROID)
#define PLATFORM_HAS_EGL 1
#define PLATFORM_HAS_GLX 0
#define PLATFORM_HAS_WGL 0
-#define EPOXY_IMPORTEXPORT
#else
#define PLATFORM_HAS_EGL 1
#define PLATFORM_HAS_GLX 1
#define PLATFORM_HAS_WGL 0
-#define EPOXY_IMPORTEXPORT
-#endif
-
-#ifndef PUBLIC
-# ifdef _WIN32
-# define PUBLIC __declspec(dllexport)
-# elif (defined(__GNUC__) && __GNUC__ >= 4) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
-# define PUBLIC __attribute__((visibility("default")))
-# else
-# define PUBLIC
-# endif
#endif
#if PLATFORM_HAS_WGL
diff --git a/src/dispatch_egl.c b/src/dispatch_egl.c
index 9649ba4..a9c5e24 100644
--- a/src/dispatch_egl.c
+++ b/src/dispatch_egl.c
@@ -38,7 +38,7 @@ epoxy_conservative_egl_version(void)
return epoxy_egl_version(dpy);
}
-PUBLIC int
+EPOXY_IMPORTEXPORT int
epoxy_egl_version(EGLDisplay dpy)
{
int major, minor;
@@ -62,7 +62,7 @@ epoxy_conservative_has_egl_extension(const char *ext)
return epoxy_has_egl_extension(dpy, ext);
}
-PUBLIC bool
+EPOXY_IMPORTEXPORT bool
epoxy_has_egl_extension(EGLDisplay dpy, const char *ext)
{
return epoxy_extension_in_string(eglQueryString(dpy, EGL_EXTENSIONS), ext);
diff --git a/src/dispatch_glx.c b/src/dispatch_glx.c
index 78e61c2..f1ff447 100644
--- a/src/dispatch_glx.c
+++ b/src/dispatch_glx.c
@@ -47,7 +47,7 @@ epoxy_conservative_glx_version(void)
return epoxy_glx_version(dpy, screen);
}
-PUBLIC int
+EPOXY_IMPORTEXPORT int
epoxy_glx_version(Display *dpy, int screen)
{
int server_major, server_minor;
@@ -92,7 +92,7 @@ epoxy_conservative_has_glx_extension(const char *ext)
return epoxy_has_glx_extension(dpy, screen, ext);
}
-PUBLIC bool
+EPOXY_IMPORTEXPORT bool
epoxy_has_glx_extension(Display *dpy, int screen, const char *ext)
{
/* No, you can't just use glXGetClientString or
diff --git a/src/dispatch_wgl.c b/src/dispatch_wgl.c
index bfe9bb1..64257a1 100644
--- a/src/dispatch_wgl.c
+++ b/src/dispatch_wgl.c
@@ -46,7 +46,7 @@ epoxy_conservative_has_wgl_extension(const char *ext)
return epoxy_has_wgl_extension(hdc, ext);
}
-PUBLIC bool
+EPOXY_IMPORTEXPORT bool
epoxy_has_wgl_extension(HDC hdc, const char *ext)
{
PFNWGLGETEXTENSIONSSTRINGARBPROC getext;
@@ -72,7 +72,7 @@ epoxy_has_wgl_extension(HDC hdc, const char *ext)
* table per context and reuse it when the context is made current
* again.
*/
-PUBLIC void
+EPOXY_IMPORTEXPORT void
epoxy_handle_external_wglMakeCurrent(void)
{
if (!first_context_current) {
@@ -190,7 +190,7 @@ WRAPPER(epoxy_wglMakeAssociatedContextCurrentAMD)(HGLRC hglrc)
return ret;
}
-PUBLIC PFNWGLMAKECURRENTPROC epoxy_wglMakeCurrent = epoxy_wglMakeCurrent_wrapped;
-PUBLIC PFNWGLMAKECONTEXTCURRENTEXTPROC epoxy_wglMakeContextCurrentEXT = epoxy_wglMakeContextCurrentEXT_wrapped;
-PUBLIC PFNWGLMAKECONTEXTCURRENTARBPROC epoxy_wglMakeContextCurrentARB = epoxy_wglMakeContextCurrentARB_wrapped;
-PUBLIC PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC epoxy_wglMakeAssociatedContextCurrentEXT = epoxy_wglMakeAssociatedContextCurrentAMD_wrapped;
+EPOXY_IMPORTEXPORT PFNWGLMAKECURRENTPROC epoxy_wglMakeCurrent = epoxy_wglMakeCurrent_wrapped;
+EPOXY_IMPORTEXPORT PFNWGLMAKECONTEXTCURRENTEXTPROC epoxy_wglMakeContextCurrentEXT = epoxy_wglMakeContextCurrentEXT_wrapped;
+EPOXY_IMPORTEXPORT PFNWGLMAKECONTEXTCURRENTARBPROC epoxy_wglMakeContextCurrentARB = epoxy_wglMakeContextCurrentARB_wrapped;
+EPOXY_IMPORTEXPORT PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC epoxy_wglMakeAssociatedContextCurrentEXT = epoxy_wglMakeAssociatedContextCurrentAMD_wrapped;
diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py
index e8f55b8..0d72010 100755
--- a/src/gen_dispatch.py
+++ b/src/gen_dispatch.py
@@ -77,7 +77,7 @@ class GLFunction(object):
self.public = ''
else:
self.wrapped_name = name
- self.public = 'PUBLIC '
+ self.public = 'EPOXY_IMPORTEXPORT '
# This is the string of C code for passing through the
# arguments to the function.