summaryrefslogtreecommitdiff
path: root/src/dispatch_common.c
diff options
context:
space:
mode:
authorEric Anholt <eric@anholt.net>2013-12-13 14:41:12 -0800
committerEric Anholt <eric@anholt.net>2013-12-15 20:15:51 -0800
commit3d2a2b3c80235bbcae97c1ba552478c40b317185 (patch)
treebbce42fe863446072220d61db4fc70259b0fe7b9 /src/dispatch_common.c
parente58e98feee46d9862fcac985f3e5b91a3f770b61 (diff)
Abandon ifuncs and go with the traditional global function pointers.
In addition to the failing testcase, there were a couple of regressions in piglit's attribs test: one from glBegin_unwrapped vs glBegin confusion in the __asm__ directives we were generating, and one where the function pointers apparently were just getting mixed up at application runtime.
Diffstat (limited to 'src/dispatch_common.c')
-rw-r--r--src/dispatch_common.c21
1 files changed, 17 insertions, 4 deletions
diff --git a/src/dispatch_common.c b/src/dispatch_common.c
index 03d08fc..11498a7 100644
--- a/src/dispatch_common.c
+++ b/src/dispatch_common.c
@@ -476,8 +476,16 @@ epoxy_print_failure_reasons(const char *name,
}
}
-PUBLIC void
-epoxy_glBegin(GLenum primtype)
+#ifdef _WIN32
+#define WRAPPER_VISIBILITY PUBLIC
+#define WRAPPER(x) x
+#else
+#define WRAPPER_VISIBILITY static
+#define WRAPPER(x) x ## _wrapped
+#endif
+
+WRAPPER_VISIBILITY void
+WRAPPER(epoxy_glBegin)(GLenum primtype)
{
#ifdef _WIN32
InterlockedIncrement(&api.begin_count);
@@ -490,8 +498,8 @@ epoxy_glBegin(GLenum primtype)
epoxy_glBegin_unwrapped(primtype);
}
-PUBLIC void
-epoxy_glEnd(void)
+WRAPPER_VISIBILITY void
+WRAPPER(epoxy_glEnd)(void)
{
epoxy_glEnd_unwrapped();
@@ -503,3 +511,8 @@ epoxy_glEnd(void)
pthread_mutex_unlock(&api.mutex);
#endif
}
+
+#ifndef _WIN32
+PUBLIC PFNGLBEGINPROC epoxy_glBegin = epoxy_glBegin_wrapped;
+PUBLIC PFNGLENDPROC epoxy_glEnd = epoxy_glEnd_wrapped;
+#endif