summaryrefslogtreecommitdiff
path: root/src/egl/main/egldriver.c
diff options
context:
space:
mode:
authorChia-I Wu <olv@lunarg.com>2010-02-19 11:47:54 +0800
committerChia-I Wu <olv@lunarg.com>2010-02-19 12:40:01 +0800
commit496724b869d4258a64e8343d3ae66d08bfb19f7b (patch)
tree048a491d6a5305c2675a71e797cfc8db0ee9e956 /src/egl/main/egldriver.c
parentbef4b476d729320599264483113d577ac5eeaff1 (diff)
egl: Silence warnings when compiled with -pedantic.
Just follow gcc's advices here.
Diffstat (limited to 'src/egl/main/egldriver.c')
-rw-r--r--src/egl/main/egldriver.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/egl/main/egldriver.c b/src/egl/main/egldriver.c
index 8748fe5f46..6384242b09 100644
--- a/src/egl/main/egldriver.c
+++ b/src/egl/main/egldriver.c
@@ -144,7 +144,13 @@ _eglOpenLibrary(const char *driverPath, lib_handle *handle)
mainFunc = (_EGLMain_t) GetProcAddress(lib, "_eglMain");
#elif defined(_EGL_PLATFORM_POSIX)
if (lib) {
- mainFunc = (_EGLMain_t) dlsym(lib, "_eglMain");
+ union {
+ _EGLMain_t func;
+ void *ptr;
+ } tmp = { NULL };
+ /* direct cast gives a warning when compiled with -pedantic */
+ tmp.ptr = dlsym(lib, "_eglMain");
+ mainFunc = tmp.func;
if (!mainFunc)
error = dlerror();
}