forked from FEX-Emu/FEX
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathHost.cpp
51 lines (38 loc) · 1.39 KB
/
Host.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
/*
$info$
tags: thunklibs|xcb-glx
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/glx.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-glx.inl"
static void fexfn_impl_libxcb_glx_FEX_xcb_glx_init_extension(xcb_connection_t * a_0, xcb_extension_t * a_1);
static size_t fexfn_impl_libxcb_glx_FEX_usable_size(void *a_0){
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_glx_FEX_free_on_host(void *a_0){
free(a_0);
}
void fexfn_impl_libxcb_glx_FEX_xcb_glx_init_extension(xcb_connection_t * a_0, xcb_extension_t * a_1){
xcb_extension_t *ext{};
if (strcmp(a_1->name, "GLX") == 0) {
ext = (xcb_extension_t *)dlsym(fexldr_ptr_libxcb_glx_so, "xcb_glx_id");
}
else {
fprintf(stderr, "Unknown xcb extension '%s'\n", a_1->name);
__builtin_trap();
return;
}
typedef const struct xcb_query_extension_reply_t * fexldr_type_libxcb_xcb_get_extension_data(xcb_connection_t * a_0,xcb_extension_t * a_1);
fexldr_type_libxcb_xcb_get_extension_data *fexldr_ptr_libxcb_xcb_get_extension_data;
fexldr_ptr_libxcb_xcb_get_extension_data = (fexldr_type_libxcb_xcb_get_extension_data*)dlsym(RTLD_DEFAULT, "xcb_get_extension_data");
[[maybe_unused]] auto res = fexldr_ptr_libxcb_xcb_get_extension_data(a_0, ext);
// Copy over the global id
a_1->global_id = ext->global_id;
}
EXPORTS(libxcb_glx)