diff options
| author | Emmanuele Bassi <ebassi@gnome.org> | 2017-01-31 18:09:34 +0000 |
|---|---|---|
| committer | Emmanuele Bassi <ebassi@gnome.org> | 2017-01-31 18:09:34 +0000 |
| commit | 5bcc550a6c85e7db4a8564aa292113e32d9993f0 (patch) | |
| tree | 5e7dc60946fa48695e7b415a276bd31a1405ad86 /src | |
| parent | 39a10ca79b58dc768ce037f4db9e347ee74e277f (diff) | |
| parent | 7a06803465dd07e152de1b30763d6bea0d3fcc93 (diff) | |
| download | libepoxy-5bcc550a6c85e7db4a8564aa292113e32d9993f0.tar.gz | |
Merge branch 'symbol-visibility'
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispatch_common.c | 10 | ||||
| -rw-r--r-- | src/dispatch_common.h | 16 | ||||
| -rw-r--r-- | src/dispatch_egl.c | 4 | ||||
| -rw-r--r-- | src/dispatch_glx.c | 4 | ||||
| -rw-r--r-- | src/dispatch_wgl.c | 12 | ||||
| -rwxr-xr-x | src/gen_dispatch.py | 16 | ||||
| -rw-r--r-- | src/meson.build | 2 |
7 files changed, 27 insertions, 37 deletions
diff --git a/src/dispatch_common.c b/src/dispatch_common.c index ab1fb92..374f6d5 100644 --- a/src/dispatch_common.c +++ b/src/dispatch_common.c @@ -269,7 +269,7 @@ do_dlsym(void **handle, const char *lib_name, const char *name, return result; } -PUBLIC bool +bool epoxy_is_desktop_gl(void) { const char *es_prefix = "OpenGL ES"; @@ -333,7 +333,7 @@ epoxy_internal_gl_version(int error_version) return 10 * major + minor; } -PUBLIC int +int epoxy_gl_version(void) { return epoxy_internal_gl_version(0); @@ -459,7 +459,7 @@ epoxy_current_context_is_glx(void) * \sa epoxy_has_egl_extension() * \sa epoxy_has_glx_extension() */ -PUBLIC bool +bool epoxy_has_gl_extension(const char *ext) { return epoxy_internal_has_gl_extension(ext, false); @@ -698,5 +698,5 @@ WRAPPER(epoxy_glEnd)(void) #endif } -PUBLIC PFNGLBEGINPROC epoxy_glBegin = epoxy_glBegin_wrapped; -PUBLIC PFNGLENDPROC epoxy_glEnd = epoxy_glEnd_wrapped; +PFNGLBEGINPROC epoxy_glBegin = epoxy_glBegin_wrapped; +PFNGLENDPROC epoxy_glEnd = epoxy_glEnd_wrapped; diff --git a/src/dispatch_common.h b/src/dispatch_common.h index 52743a6..40d4bbc 100644 --- a/src/dispatch_common.h +++ b/src/dispatch_common.h @@ -21,28 +21,26 @@ * IN THE SOFTWARE. */ +#include "config.h" + #include <stdbool.h> #ifdef _WIN32 #define PLATFORM_HAS_EGL 0 #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 #include "epoxy/gl.h" @@ -56,16 +54,6 @@ #include "epoxy/wgl.h" #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 defined(__GNUC__) #define PACKED __attribute__((__packed__)) #define ENDPACKED diff --git a/src/dispatch_egl.c b/src/dispatch_egl.c index b42aacd..d1dc53c 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 +int epoxy_egl_version(EGLDisplay dpy) { int major, minor; @@ -57,7 +57,7 @@ epoxy_conservative_has_egl_extension(const char *ext) return epoxy_has_egl_extension(eglGetCurrentDisplay(), ext); } -PUBLIC bool +bool epoxy_has_egl_extension(EGLDisplay dpy, const char *ext) { return epoxy_extension_in_string(eglQueryString(dpy, EGL_EXTENSIONS), ext) || epoxy_extension_in_string(eglQueryString(NULL, EGL_EXTENSIONS), ext); diff --git a/src/dispatch_glx.c b/src/dispatch_glx.c index 9e4cef6..9396f1c 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 +int epoxy_glx_version(Display *dpy, int screen) { int server_major, server_minor; @@ -98,7 +98,7 @@ epoxy_conservative_has_glx_extension(const char *ext) return epoxy_has_glx_extension(dpy, screen, ext); } -PUBLIC bool +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..fe5379d 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 +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 +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; +PFNWGLMAKECURRENTPROC epoxy_wglMakeCurrent = epoxy_wglMakeCurrent_wrapped; +PFNWGLMAKECONTEXTCURRENTEXTPROC epoxy_wglMakeContextCurrentEXT = epoxy_wglMakeContextCurrentEXT_wrapped; +PFNWGLMAKECONTEXTCURRENTARBPROC epoxy_wglMakeContextCurrentARB = epoxy_wglMakeContextCurrentARB_wrapped; +PFNWGLMAKEASSOCIATEDCONTEXTCURRENTAMDPROC epoxy_wglMakeAssociatedContextCurrentEXT = epoxy_wglMakeAssociatedContextCurrentAMD_wrapped; diff --git a/src/gen_dispatch.py b/src/gen_dispatch.py index 013a4bd..548c2bb 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_PUBLIC ' # This is the string of C code for passing through the # arguments to the function. @@ -485,6 +485,8 @@ class Generator(object): def write_header(self, file): self.write_header_header(file) + self.outln('#include "epoxy/common.h"') + if self.target != "gl": self.outln('#include "epoxy/gl.h"') if self.target == "egl": @@ -529,9 +531,9 @@ class Generator(object): self.write_function_ptr_typedefs() for func in self.sorted_functions: - self.outln('extern EPOXY_IMPORTEXPORT {0} (EPOXY_CALLSPEC *epoxy_{1})({2});'.format(func.ret_type, - func.name, - func.args_decl)) + self.outln('EPOXY_PUBLIC {0} (EPOXY_CALLSPEC *epoxy_{1})({2});'.format(func.ret_type, + func.name, + func.args_decl)) self.outln('') for func in self.sorted_functions: @@ -621,9 +623,7 @@ class Generator(object): func.args_list)) def write_function_pointer(self, func): - self.outln('{0}{1} epoxy_{2} = epoxy_{2}_global_rewrite_ptr;'.format(func.public, - func.ptr_type, - func.wrapped_name)) + self.outln('{0} epoxy_{1} = epoxy_{1}_global_rewrite_ptr;'.format(func.ptr_type, func.wrapped_name)) self.outln('') def write_provider_enums(self): @@ -753,6 +753,8 @@ class Generator(object): self.write_copyright_comment_body() self.outln(' */') self.outln('') + self.outln('#include "config.h"') + self.outln('') self.outln('#include <stdlib.h>') self.outln('#include <string.h>') self.outln('#include <stdio.h>') diff --git a/src/meson.build b/src/meson.build index f6df778..fced355 100644 --- a/src/meson.build +++ b/src/meson.build @@ -103,7 +103,7 @@ if libtype != 'shared' install: true, dependencies: epoxy_deps, include_directories: libepoxy_inc, - c_args: common_cflags, + c_args: common_cflags + visibility_cflags, link_args: common_ldflags) libepoxy = libepoxy_static endif |
