summaryrefslogtreecommitdiff
path: root/src/mapi/mapi/entry.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/mapi/mapi/entry.c')
-rw-r--r--src/mapi/mapi/entry.c21
1 files changed, 21 insertions, 0 deletions
diff --git a/src/mapi/mapi/entry.c b/src/mapi/mapi/entry.c
index faeda83519..f378ccfda9 100644
--- a/src/mapi/mapi/entry.c
+++ b/src/mapi/mapi/entry.c
@@ -33,6 +33,13 @@
/* define macros for use by assembly dispatchers */
#define ENTRY_CURRENT_TABLE U_STRINGIFY(u_current_table)
+/* in bridge mode, mapi is a user of glapi */
+#ifdef MAPI_MODE_BRIDGE
+#define ENTRY_CURRENT_TABLE_GET "_glapi_get_dispatch"
+#else
+#define ENTRY_CURRENT_TABLE_GET "u_current_get_internal"
+#endif
+
#if defined(USE_X86_ASM) && defined(__GNUC__)
# ifdef GLX_USE_TLS
# include "entry_x86_tls.h"
@@ -45,12 +52,24 @@
#include <stdlib.h>
+static INLINE const struct mapi_table *
+entry_current_get(void)
+{
+#ifdef MAPI_MODE_BRIDGE
+ return GET_DISPATCH();
+#else
+ return u_current_get();
+#endif
+}
+
/* C version of the public entries */
#define MAPI_TMP_DEFINES
#define MAPI_TMP_PUBLIC_DECLARES
#define MAPI_TMP_PUBLIC_ENTRIES
#include "mapi_tmp.h"
+#ifndef MAPI_MODE_BRIDGE
+
void
entry_patch_public(void)
{
@@ -74,4 +93,6 @@ entry_patch(mapi_func entry, int slot)
{
}
+#endif /* MAPI_MODE_BRIDGE */
+
#endif /* asm */