mirror of
https://github.com/FEX-Emu/FEX.git
synced 2025-02-08 23:57:05 +00:00
Thunks: Use libclang-based code generation for libxcb-dri2
This commit is contained in:
parent
99bf02f27f
commit
c9a7b36210
@ -1,80 +0,0 @@
|
||||
#!/usr/bin/python3
|
||||
from ThunkHelpers import *
|
||||
|
||||
lib_with_filename("libxcb_dri2", "0", "libxcb-dri2")
|
||||
|
||||
# FEX
|
||||
fn("void FEX_xcb_dri2_init_extension(xcb_connection_t *, xcb_extension_t *)"); no_unpack()
|
||||
fn("size_t FEX_usable_size(void*)"); no_unpack()
|
||||
fn("void FEX_free_on_host(void*)"); no_unpack()
|
||||
|
||||
fn("void xcb_dri2_dri2_buffer_next(xcb_dri2_dri2_buffer_iterator_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_dri2_buffer_end(xcb_dri2_dri2_buffer_iterator_t)")
|
||||
fn("void xcb_dri2_attach_format_next(xcb_dri2_attach_format_iterator_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_attach_format_end(xcb_dri2_attach_format_iterator_t)")
|
||||
fn("xcb_dri2_query_version_cookie_t xcb_dri2_query_version(xcb_connection_t *, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_query_version_cookie_t xcb_dri2_query_version_unchecked(xcb_connection_t *, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply(xcb_connection_t *, xcb_dri2_query_version_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("int xcb_dri2_connect_sizeof(const void *)")
|
||||
fn("xcb_dri2_connect_cookie_t xcb_dri2_connect(xcb_connection_t *, xcb_window_t, uint32_t)"); no_pack()
|
||||
fn("xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked(xcb_connection_t *, xcb_window_t, uint32_t)"); no_pack()
|
||||
# ::Iterator::
|
||||
fn("char * xcb_dri2_connect_driver_name(const xcb_dri2_connect_reply_t *)")
|
||||
fn("int xcb_dri2_connect_driver_name_length(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_connect_driver_name_end(const xcb_dri2_connect_reply_t *)")
|
||||
# ::Iterator::
|
||||
fn("void * xcb_dri2_connect_alignment_pad(const xcb_dri2_connect_reply_t *)")
|
||||
fn("int xcb_dri2_connect_alignment_pad_length(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_connect_alignment_pad_end(const xcb_dri2_connect_reply_t *)")
|
||||
# ::Iterator::
|
||||
fn("char * xcb_dri2_connect_device_name(const xcb_dri2_connect_reply_t *)")
|
||||
fn("int xcb_dri2_connect_device_name_length(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_generic_iterator_t xcb_dri2_connect_device_name_end(const xcb_dri2_connect_reply_t *)")
|
||||
fn("xcb_dri2_connect_reply_t * xcb_dri2_connect_reply(xcb_connection_t *, xcb_dri2_connect_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate(xcb_connection_t *, xcb_window_t, uint32_t)")
|
||||
fn("xcb_dri2_authenticate_cookie_t xcb_dri2_authenticate_unchecked(xcb_connection_t *, xcb_window_t, uint32_t)")
|
||||
fn("xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply(xcb_connection_t *, xcb_dri2_authenticate_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_void_cookie_t xcb_dri2_create_drawable_checked(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_create_drawable(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_destroy_drawable_checked(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_destroy_drawable(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("int xcb_dri2_get_buffers_sizeof(const void *, uint32_t)")
|
||||
fn("xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const uint32_t *)")
|
||||
fn("xcb_dri2_get_buffers_cookie_t xcb_dri2_get_buffers_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const uint32_t *)")
|
||||
# ::Iterator::
|
||||
fn("xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_buffers(const xcb_dri2_get_buffers_reply_t *)")
|
||||
fn("int xcb_dri2_get_buffers_buffers_length(const xcb_dri2_get_buffers_reply_t *)")
|
||||
fn("xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_buffers_iterator(const xcb_dri2_get_buffers_reply_t *)")
|
||||
|
||||
fn("xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply(xcb_connection_t *, xcb_dri2_get_buffers_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_copy_region_cookie_t xcb_dri2_copy_region_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply(xcb_connection_t *, xcb_dri2_copy_region_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("int xcb_dri2_get_buffers_with_format_sizeof(const void *, uint32_t)")
|
||||
fn("xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const xcb_dri2_attach_format_t *)")
|
||||
fn("xcb_dri2_get_buffers_with_format_cookie_t xcb_dri2_get_buffers_with_format_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, const xcb_dri2_attach_format_t *)")
|
||||
# ::Iterator::
|
||||
fn("xcb_dri2_dri2_buffer_t * xcb_dri2_get_buffers_with_format_buffers(const xcb_dri2_get_buffers_with_format_reply_t *)")
|
||||
fn("int xcb_dri2_get_buffers_with_format_buffers_length(const xcb_dri2_get_buffers_with_format_reply_t *)")
|
||||
fn("xcb_dri2_dri2_buffer_iterator_t xcb_dri2_get_buffers_with_format_buffers_iterator(const xcb_dri2_get_buffers_with_format_reply_t *)")
|
||||
|
||||
fn("xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply(xcb_connection_t *, xcb_dri2_get_buffers_with_format_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_swap_buffers_cookie_t xcb_dri2_swap_buffers_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply(xcb_connection_t *, xcb_dri2_swap_buffers_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_dri2_get_msc_cookie_t xcb_dri2_get_msc_unchecked(xcb_connection_t *, xcb_drawable_t)")
|
||||
fn("xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply(xcb_connection_t *, xcb_dri2_get_msc_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_msc_cookie_t xcb_dri2_wait_msc_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply(xcb_connection_t *, xcb_dri2_wait_msc_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_sbc_cookie_t xcb_dri2_wait_sbc_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t, uint32_t)")
|
||||
fn("xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply(xcb_connection_t *, xcb_dri2_wait_sbc_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
fn("xcb_void_cookie_t xcb_dri2_swap_interval_checked(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_void_cookie_t xcb_dri2_swap_interval(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_dri2_get_param_cookie_t xcb_dri2_get_param(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_dri2_get_param_cookie_t xcb_dri2_get_param_unchecked(xcb_connection_t *, xcb_drawable_t, uint32_t)")
|
||||
fn("xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply(xcb_connection_t *, xcb_dri2_get_param_cookie_t, xcb_generic_error_t **)"); no_pack()
|
||||
|
||||
Generate()
|
@ -243,8 +243,8 @@ endif()
|
||||
generate_new(libxcb ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb/libxcb_interface.cpp thunks function_packs function_packs_public callback_structs callback_unpacks_header callback_unpacks_header_init callback_unpacks callback_typedefs)
|
||||
add_guest_lib(xcb)
|
||||
|
||||
generate(libxcb_dri2 thunks function_packs function_packs_public)
|
||||
add_guest_lib(xcb_dri2)
|
||||
generate_new(libxcb-dri2 ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-dri2/libxcb-dri2_interface.cpp thunks function_packs function_packs_public)
|
||||
add_guest_lib(xcb-dri2)
|
||||
|
||||
generate(libxcb_dri3 thunks function_packs function_packs_public)
|
||||
add_guest_lib(xcb_dri3)
|
||||
|
@ -164,8 +164,8 @@ endforeach()
|
||||
generate_new(libxcb ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb/libxcb_interface.cpp function_unpacks tab_function_unpacks ldr ldr_ptrs callback_structs callback_unpacks_header callback_typedefs)
|
||||
add_host_lib(xcb)
|
||||
|
||||
generate(libxcb_dri2 function_unpacks tab_function_unpacks ldr ldr_ptrs)
|
||||
add_host_lib(xcb_dri2)
|
||||
generate_new(libxcb-dri2 ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-dri2/libxcb-dri2_interface.cpp function_unpacks tab_function_unpacks ldr ldr_ptrs)
|
||||
add_host_lib(xcb-dri2)
|
||||
|
||||
generate(libxcb_dri3 function_unpacks tab_function_unpacks ldr ldr_ptrs)
|
||||
add_host_lib(xcb_dri3)
|
||||
|
345
ThunkLibs/libxcb-dri2/libxcb-dri2_Guest.cpp
Normal file
345
ThunkLibs/libxcb-dri2/libxcb-dri2_Guest.cpp
Normal file
@ -0,0 +1,345 @@
|
||||
/*
|
||||
$info$
|
||||
tags: thunklibs|xcb-dri2
|
||||
$end_info$
|
||||
*/
|
||||
|
||||
#include <xcb/dri2.h>
|
||||
#include <xcb/xcbext.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "common/Guest.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "thunks.inl"
|
||||
#include "function_packs.inl"
|
||||
#include "function_packs_public.inl"
|
||||
|
||||
|
||||
extern "C" {
|
||||
xcb_extension_t xcb_dri2_id = {
|
||||
.name = "DRI2",
|
||||
.global_id = 0,
|
||||
};
|
||||
|
||||
void FEX_malloc_free_on_host(void *Ptr) {
|
||||
struct {void *p;} args;
|
||||
args.p = Ptr;
|
||||
fexthunks_libxcb_dri2_FEX_free_on_host(&args);
|
||||
}
|
||||
|
||||
size_t FEX_malloc_usable_size(void *Ptr) {
|
||||
struct {void *p; size_t rv;} args;
|
||||
args.p = Ptr;
|
||||
fexthunks_libxcb_dri2_FEX_usable_size(&args);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static void InitializeExtensions(xcb_connection_t *c) {
|
||||
FEX_xcb_dri2_init_extension(c, &xcb_dri2_id);
|
||||
}
|
||||
|
||||
xcb_dri2_connect_cookie_t xcb_dri2_connect(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_connect(a_0, a_1, a_2);
|
||||
InitializeExtensions(a_0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_connect_unchecked(a_0, a_1, a_2);
|
||||
InitializeExtensions(a_0);
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply(xcb_connection_t * a_0,xcb_dri2_query_version_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_query_version_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_connect_reply_t * xcb_dri2_connect_reply(xcb_connection_t * a_0,xcb_dri2_connect_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_connect_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply(xcb_connection_t * a_0,xcb_dri2_authenticate_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_authenticate_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_get_buffers_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply(xcb_connection_t * a_0,xcb_dri2_copy_region_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_copy_region_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_with_format_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_get_buffers_with_format_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply(xcb_connection_t * a_0,xcb_dri2_swap_buffers_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_swap_buffers_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply(xcb_connection_t * a_0,xcb_dri2_get_msc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_get_msc_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply(xcb_connection_t * a_0,xcb_dri2_wait_msc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_wait_msc_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply(xcb_connection_t * a_0,xcb_dri2_wait_sbc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_wait_sbc_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply(xcb_connection_t * a_0,xcb_dri2_get_param_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
auto ret = fexfn_pack_xcb_dri2_get_param_reply(a_0, a_1, a_2);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (ret) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(ret)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, ret, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(ret);
|
||||
ret = (decltype(ret))NewPtr;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
LOAD_LIB(libxcb_dri2)
|
@ -15,22 +15,19 @@ $end_info$
|
||||
#include <malloc.h>
|
||||
|
||||
#include "ldr_ptrs.inl"
|
||||
|
||||
static void fexfn_impl_libxcb_dri2_FEX_xcb_dri2_init_extension(xcb_connection_t * a_0, xcb_extension_t * a_1);
|
||||
|
||||
static size_t fexfn_impl_libxcb_dri2_FEX_usable_size(void *a_0){
|
||||
return malloc_usable_size(a_0);
|
||||
}
|
||||
|
||||
static void fexfn_impl_libxcb_dri2_FEX_free_on_host(void *a_0){
|
||||
free(a_0);
|
||||
}
|
||||
|
||||
#include "function_unpacks.inl"
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_xcb_dri2_init_extension(void *argsv);
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_usable_size(void *argsv){
|
||||
struct arg_t {void* a_0;size_t rv;};
|
||||
auto args = (arg_t*)argsv;
|
||||
args->rv = malloc_usable_size(args->a_0);
|
||||
}
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_free_on_host(void *argsv){
|
||||
struct arg_t {void* a_0;};
|
||||
auto args = (arg_t*)argsv;
|
||||
free(args->a_0);
|
||||
}
|
||||
|
||||
static ExportEntry exports[] = {
|
||||
#include "tab_function_unpacks.inl"
|
||||
{ nullptr, nullptr }
|
||||
@ -38,15 +35,13 @@ static ExportEntry exports[] = {
|
||||
|
||||
#include "ldr.inl"
|
||||
|
||||
void fexfn_unpack_libxcb_dri2_FEX_xcb_dri2_init_extension(void *argsv){
|
||||
struct arg_t {xcb_connection_t * a_0;xcb_extension_t * a_1;};
|
||||
auto args = (arg_t*)argsv;
|
||||
static void fexfn_impl_libxcb_dri2_FEX_xcb_dri2_init_extension(xcb_connection_t * a_0, xcb_extension_t * a_1){
|
||||
xcb_extension_t *ext{};
|
||||
if (strcmp(args->a_1->name, "DRI2") == 0) {
|
||||
if (strcmp(a_1->name, "DRI2") == 0) {
|
||||
ext = (xcb_extension_t *)dlsym(fexldr_ptr_libxcb_dri2_so, "xcb_dri2_id");
|
||||
}
|
||||
else {
|
||||
fprintf(stderr, "Unknown xcb extension '%s'\n", args->a_1->name);
|
||||
fprintf(stderr, "Unknown xcb extension '%s'\n", a_1->name);
|
||||
__builtin_trap();
|
||||
return;
|
||||
}
|
||||
@ -56,10 +51,10 @@ void fexfn_unpack_libxcb_dri2_FEX_xcb_dri2_init_extension(void *argsv){
|
||||
|
||||
fexldr_ptr_libxcb_xcb_get_extension_data = (fexldr_type_libxcb_xcb_get_extension_data*)dlsym(RTLD_DEFAULT, "xcb_get_extension_data");
|
||||
|
||||
auto res = fexldr_ptr_libxcb_xcb_get_extension_data(args->a_0, ext);
|
||||
auto res = fexldr_ptr_libxcb_xcb_get_extension_data(a_0, ext);
|
||||
|
||||
// Copy over the global id
|
||||
args->a_1->global_id = ext->global_id;
|
||||
a_1->global_id = ext->global_id;
|
||||
}
|
||||
|
||||
EXPORTS(libxcb_dri2)
|
78
ThunkLibs/libxcb-dri2/libxcb-dri2_interface.cpp
Normal file
78
ThunkLibs/libxcb-dri2/libxcb-dri2_interface.cpp
Normal file
@ -0,0 +1,78 @@
|
||||
#include <common/GeneratorInterface.h>
|
||||
|
||||
#include <xcb/dri2.h>
|
||||
|
||||
template<auto>
|
||||
struct fex_gen_config;
|
||||
|
||||
void FEX_xcb_dri2_init_extension(xcb_connection_t*, xcb_extension_t*);
|
||||
size_t FEX_usable_size(void*);
|
||||
void FEX_free_on_host(void*);
|
||||
|
||||
template<> struct fex_gen_config<FEX_xcb_dri2_init_extension> : fexgen::custom_host_impl {};
|
||||
template<> struct fex_gen_config<FEX_usable_size> : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<FEX_free_on_host> : fexgen::custom_host_impl, fexgen::custom_guest_entrypoint {};
|
||||
|
||||
template<> struct fex_gen_config<xcb_dri2_dri2_buffer_next> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_dri2_buffer_end> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_attach_format_next> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_attach_format_end> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_query_version> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_query_version_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_query_version_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_sizeof> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_unchecked> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_driver_name> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_driver_name_length> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_driver_name_end> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_alignment_pad> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_alignment_pad_length> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_alignment_pad_end> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_device_name> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_device_name_length> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_device_name_end> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_connect_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_authenticate> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_authenticate_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_authenticate_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_create_drawable_checked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_create_drawable> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_destroy_drawable_checked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_destroy_drawable> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_sizeof> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_buffers> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_buffers_length> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_buffers_iterator> {};
|
||||
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_copy_region> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_copy_region_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_copy_region_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format_sizeof> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format_buffers> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format_buffers_length> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format_buffers_iterator> {};
|
||||
|
||||
template<> struct fex_gen_config<xcb_dri2_get_buffers_with_format_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_swap_buffers> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_swap_buffers_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_swap_buffers_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_msc> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_msc_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_msc_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_wait_msc> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_wait_msc_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_wait_msc_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_wait_sbc> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_wait_sbc_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_wait_sbc_reply> : fexgen::custom_guest_entrypoint {};
|
||||
template<> struct fex_gen_config<xcb_dri2_swap_interval_checked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_swap_interval> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_param> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_param_unchecked> {};
|
||||
template<> struct fex_gen_config<xcb_dri2_get_param_reply> : fexgen::custom_guest_entrypoint {};
|
@ -1,385 +0,0 @@
|
||||
/*
|
||||
$info$
|
||||
tags: thunklibs|xcb-dri2
|
||||
$end_info$
|
||||
*/
|
||||
|
||||
#include <xcb/dri2.h>
|
||||
#include <xcb/xcbext.h>
|
||||
|
||||
#include <stdio.h>
|
||||
#include <cstring>
|
||||
#include <map>
|
||||
#include <string>
|
||||
|
||||
#include "common/Guest.h"
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "thunks.inl"
|
||||
#include "function_packs.inl"
|
||||
#include "function_packs_public.inl"
|
||||
|
||||
|
||||
extern "C" {
|
||||
xcb_extension_t xcb_dri2_id = {
|
||||
.name = "DRI2",
|
||||
.global_id = 0,
|
||||
};
|
||||
|
||||
void FEX_malloc_free_on_host(void *Ptr) {
|
||||
struct {void *p;} args;
|
||||
args.p = Ptr;
|
||||
fexthunks_libxcb_dri2_FEX_free_on_host(&args);
|
||||
}
|
||||
|
||||
size_t FEX_malloc_usable_size(void *Ptr) {
|
||||
struct {void *p; size_t rv;} args;
|
||||
args.p = Ptr;
|
||||
fexthunks_libxcb_dri2_FEX_usable_size(&args);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static void InitializeExtensions(xcb_connection_t *c) {
|
||||
FEX_xcb_dri2_init_extension(c, &xcb_dri2_id);
|
||||
}
|
||||
|
||||
static xcb_dri2_connect_cookie_t fexfn_pack_xcb_dri2_connect(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_window_t a_1;uint32_t a_2;xcb_dri2_connect_cookie_t rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_connect(&args);
|
||||
InitializeExtensions(a_0);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_connect_cookie_t fexfn_pack_xcb_dri2_connect_unchecked(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_window_t a_1;uint32_t a_2;xcb_dri2_connect_cookie_t rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_connect_unchecked(&args);
|
||||
InitializeExtensions(a_0);
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_query_version_reply_t * fexfn_pack_xcb_dri2_query_version_reply(xcb_connection_t * a_0,xcb_dri2_query_version_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_query_version_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_query_version_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_query_version_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_connect_reply_t * fexfn_pack_xcb_dri2_connect_reply(xcb_connection_t * a_0,xcb_dri2_connect_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_connect_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_connect_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_connect_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_authenticate_reply_t * fexfn_pack_xcb_dri2_authenticate_reply(xcb_connection_t * a_0,xcb_dri2_authenticate_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_authenticate_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_authenticate_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_authenticate_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_buffers_reply_t * fexfn_pack_xcb_dri2_get_buffers_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_buffers_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_buffers_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_buffers_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_copy_region_reply_t * fexfn_pack_xcb_dri2_copy_region_reply(xcb_connection_t * a_0,xcb_dri2_copy_region_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_copy_region_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_copy_region_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_copy_region_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_buffers_with_format_reply_t * fexfn_pack_xcb_dri2_get_buffers_with_format_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_with_format_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_buffers_with_format_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_buffers_with_format_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_buffers_with_format_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_swap_buffers_reply_t * fexfn_pack_xcb_dri2_swap_buffers_reply(xcb_connection_t * a_0,xcb_dri2_swap_buffers_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_swap_buffers_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_swap_buffers_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_swap_buffers_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_msc_reply_t * fexfn_pack_xcb_dri2_get_msc_reply(xcb_connection_t * a_0,xcb_dri2_get_msc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_msc_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_msc_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_msc_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_wait_msc_reply_t * fexfn_pack_xcb_dri2_wait_msc_reply(xcb_connection_t * a_0,xcb_dri2_wait_msc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_wait_msc_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_wait_msc_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_wait_msc_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_wait_sbc_reply_t * fexfn_pack_xcb_dri2_wait_sbc_reply(xcb_connection_t * a_0,xcb_dri2_wait_sbc_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_wait_sbc_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_wait_sbc_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_wait_sbc_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
static xcb_dri2_get_param_reply_t * fexfn_pack_xcb_dri2_get_param_reply(xcb_connection_t * a_0,xcb_dri2_get_param_cookie_t a_1,xcb_generic_error_t ** a_2){
|
||||
struct {xcb_connection_t * a_0;xcb_dri2_get_param_cookie_t a_1;xcb_generic_error_t ** a_2;xcb_dri2_get_param_reply_t * rv;} args;
|
||||
args.a_0 = a_0;args.a_1 = a_1;args.a_2 = a_2;
|
||||
fexthunks_libxcb_dri2_xcb_dri2_get_param_reply(&args);
|
||||
|
||||
// We now need to do some fixups here
|
||||
if (a_2 && *a_2) {
|
||||
// If the error code pointer exists then we need to copy the contents and free the host facing pointer
|
||||
xcb_generic_error_t *NewError = (xcb_generic_error_t *)malloc(sizeof(xcb_generic_error_t));
|
||||
memcpy(NewError, *a_2, sizeof(xcb_generic_error_t));
|
||||
FEX_malloc_free_on_host(*a_2);
|
||||
|
||||
// User is expected to free this
|
||||
*a_2 = NewError;
|
||||
}
|
||||
|
||||
if (args.rv) {
|
||||
constexpr size_t ResultSize = sizeof(std::remove_pointer<decltype(args.rv)>::type);
|
||||
void *NewPtr = malloc(ResultSize);
|
||||
memcpy(NewPtr, args.rv, ResultSize);
|
||||
|
||||
FEX_malloc_free_on_host(args.rv);
|
||||
args.rv = (decltype(args.rv))NewPtr;
|
||||
}
|
||||
|
||||
return args.rv;
|
||||
}
|
||||
|
||||
xcb_dri2_connect_cookie_t xcb_dri2_connect(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2) __attribute__((alias("fexfn_pack_xcb_dri2_connect")));
|
||||
xcb_dri2_connect_cookie_t xcb_dri2_connect_unchecked(xcb_connection_t * a_0,xcb_window_t a_1,uint32_t a_2) __attribute__((alias("fexfn_pack_xcb_dri2_connect_unchecked")));
|
||||
xcb_dri2_query_version_reply_t * xcb_dri2_query_version_reply(xcb_connection_t * a_0,xcb_dri2_query_version_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_query_version_reply")));
|
||||
xcb_dri2_connect_reply_t * xcb_dri2_connect_reply(xcb_connection_t * a_0,xcb_dri2_connect_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_connect_reply")));
|
||||
xcb_dri2_authenticate_reply_t * xcb_dri2_authenticate_reply(xcb_connection_t * a_0,xcb_dri2_authenticate_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_authenticate_reply")));
|
||||
xcb_dri2_get_buffers_reply_t * xcb_dri2_get_buffers_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_buffers_reply")));
|
||||
xcb_dri2_copy_region_reply_t * xcb_dri2_copy_region_reply(xcb_connection_t * a_0,xcb_dri2_copy_region_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_copy_region_reply")));
|
||||
xcb_dri2_get_buffers_with_format_reply_t * xcb_dri2_get_buffers_with_format_reply(xcb_connection_t * a_0,xcb_dri2_get_buffers_with_format_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_buffers_with_format_reply")));
|
||||
xcb_dri2_swap_buffers_reply_t * xcb_dri2_swap_buffers_reply(xcb_connection_t * a_0,xcb_dri2_swap_buffers_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_swap_buffers_reply")));
|
||||
xcb_dri2_get_msc_reply_t * xcb_dri2_get_msc_reply(xcb_connection_t * a_0,xcb_dri2_get_msc_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_msc_reply")));
|
||||
xcb_dri2_wait_msc_reply_t * xcb_dri2_wait_msc_reply(xcb_connection_t * a_0,xcb_dri2_wait_msc_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_wait_msc_reply")));
|
||||
xcb_dri2_wait_sbc_reply_t * xcb_dri2_wait_sbc_reply(xcb_connection_t * a_0,xcb_dri2_wait_sbc_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_wait_sbc_reply")));
|
||||
xcb_dri2_get_param_reply_t * xcb_dri2_get_param_reply(xcb_connection_t * a_0,xcb_dri2_get_param_cookie_t a_1,xcb_generic_error_t ** a_2) __attribute__((alias("fexfn_pack_xcb_dri2_get_param_reply")));
|
||||
}
|
||||
|
||||
LOAD_LIB(libxcb_dri2)
|
Loading…
x
Reference in New Issue
Block a user