Library Forwarding: Drop support for libX11

The implementation of this has been brittle and is architecturally
incompatible with 32-bit guests. It's unlikely this could be fixed with
incremental improvements.

Since libGL and libvulkan can be forwarded independently of libX11 now,
these libX11 bits can be dropped without negative impact on compatibility.
This commit is contained in:
Tony Wasserka committed 2024-05-02 20:02:02 +02:00
1 parent 4b76eb0b3f
commit a15ed4c9da
33 files changed
-14280

No files matched your search

-62
View File
@@ -195,72 +195,10 @@ if (BITNESS EQUAL 64)
# target_link_libraries(SDL2-guest PRIVATE GL)
# target_link_libraries(SDL2-guest PRIVATE dl)
find_package(PkgConfig)
pkg_search_module(X11 REQUIRED x11)
version_to_variables(${X11_VERSION} X11)
generate(libX11 ${CMAKE_CURRENT_SOURCE_DIR}/../libX11/libX11_interface.cpp)
add_guest_lib(X11 "libX11.so.6")
target_compile_definitions(libX11-guest-deps INTERFACE -DX11_VERSION_MAJOR=${X11_VERSION_MAJOR})
target_compile_definitions(libX11-guest-deps INTERFACE -DX11_VERSION_MINOR=${X11_VERSION_MINOR})
target_compile_definitions(libX11-guest-deps INTERFACE -DX11_VERSION_PATCH=${X11_VERSION_PATCH})
generate(libXext ${CMAKE_CURRENT_SOURCE_DIR}/../libXext/libXext_interface.cpp)
add_guest_lib(Xext "libXext.so.6")
target_compile_definitions(libXext-guest-deps INTERFACE -DX11_VERSION_MAJOR=${X11_VERSION_MAJOR})
target_compile_definitions(libXext-guest-deps INTERFACE -DX11_VERSION_MINOR=${X11_VERSION_MINOR})
target_compile_definitions(libXext-guest-deps INTERFACE -DX11_VERSION_PATCH=${X11_VERSION_PATCH})
generate(libXrender ${CMAKE_CURRENT_SOURCE_DIR}/../libXrender/libXrender_interface.cpp)
add_guest_lib(Xrender "libXrender.so.1")
generate(libXfixes ${CMAKE_CURRENT_SOURCE_DIR}/../libXfixes/libXfixes_interface.cpp)
add_guest_lib(Xfixes "libXfixes.so.3")
generate(libvulkan ${CMAKE_CURRENT_SOURCE_DIR}/../libvulkan/libvulkan_interface.cpp)
target_include_directories(libvulkan-guest-deps INTERFACE ${FEX_PROJECT_SOURCE_DIR}/External/Vulkan-Headers/include/)
add_guest_lib(vulkan "libvulkan.so.1")
find_package(PkgConfig)
pkg_search_module(XCB REQUIRED xcb)
version_to_variables(${XCB_VERSION} XCB)
generate(libxcb ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb/libxcb_interface.cpp)
add_guest_lib(xcb "libxcb.so.1")
target_compile_definitions(libxcb-guest-deps INTERFACE -DXCB_VERSION_MAJOR=${XCB_VERSION_MAJOR})
target_compile_definitions(libxcb-guest-deps INTERFACE -DXCB_VERSION_MINOR=${XCB_VERSION_MINOR})
target_compile_definitions(libxcb-guest-deps INTERFACE -DXCB_VERSION_PATCH=${XCB_VERSION_PATCH})
generate(libxcb-dri2 ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-dri2/libxcb-dri2_interface.cpp)
add_guest_lib(xcb-dri2 "libxcb-dri2.so.0")
generate(libxcb-dri3 ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-dri3/libxcb-dri3_interface.cpp)
add_guest_lib(xcb-dri3 "libxcb-dri3.so.0")
generate(libxcb-xfixes ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-xfixes/libxcb-xfixes_interface.cpp)
add_guest_lib(xcb-xfixes "libxcb-xfixes.so.0")
generate(libxcb-shm ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-shm/libxcb-shm_interface.cpp)
add_guest_lib(xcb-shm "libxcb-shm.so.0")
generate(libxcb-sync ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-sync/libxcb-sync_interface.cpp)
add_guest_lib(xcb-sync "libxcb-sync.so.1")
generate(libxcb-present ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-present/libxcb-present_interface.cpp)
add_guest_lib(xcb-present "libxcb-present.so.0")
generate(libxcb-randr ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-randr/libxcb-randr_interface.cpp)
add_guest_lib(xcb-randr "libxcb-randr.so.0")
generate(libxcb-glx ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-glx/libxcb-glx_interface.cpp)
add_guest_lib(xcb-glx "libxcb-glx.so.0")
generate(libxshmfence ${CMAKE_CURRENT_SOURCE_DIR}/../libxshmfence/libxshmfence_interface.cpp)
add_guest_lib(xshmfence "libxshmfence.so.1")
generate(libdrm ${CMAKE_CURRENT_SOURCE_DIR}/../libdrm/libdrm_interface.cpp)
target_include_directories(libdrm-guest-deps INTERFACE /usr/include/drm/)
target_include_directories(libdrm-guest-deps INTERFACE /usr/include/libdrm/)
-62
View File
@@ -124,72 +124,10 @@ foreach(GUEST_BITNESS IN LISTS BITNESS_LIST)
# add_host_lib(SDL2 ${GUEST_BITNESS})
# target_include_directories(SDL2-host PRIVATE ${SDL2_INCLUDE_DIRS})
find_package(PkgConfig)
pkg_search_module(X11 REQUIRED x11)
version_to_variables(${X11_VERSION} X11)
generate(libX11 ${CMAKE_CURRENT_SOURCE_DIR}/../libX11/libX11_interface.cpp ${GUEST_BITNESS})
add_host_lib(X11 ${GUEST_BITNESS})
target_compile_definitions(libX11-${GUEST_BITNESS}-deps INTERFACE -DX11_VERSION_MAJOR=${X11_VERSION_MAJOR})
target_compile_definitions(libX11-${GUEST_BITNESS}-deps INTERFACE -DX11_VERSION_MINOR=${X11_VERSION_MINOR})
target_compile_definitions(libX11-${GUEST_BITNESS}-deps INTERFACE -DX11_VERSION_PATCH=${X11_VERSION_PATCH})
generate(libXext ${CMAKE_CURRENT_SOURCE_DIR}/../libXext/libXext_interface.cpp ${GUEST_BITNESS})
add_host_lib(Xext ${GUEST_BITNESS})
target_compile_definitions(libXext-${GUEST_BITNESS}-deps INTERFACE -DX11_VERSION_MAJOR=${X11_VERSION_MAJOR})
target_compile_definitions(libXext-${GUEST_BITNESS}-deps INTERFACE -DX11_VERSION_MINOR=${X11_VERSION_MINOR})
target_compile_definitions(libXext-${GUEST_BITNESS}-deps INTERFACE -DX11_VERSION_PATCH=${X11_VERSION_PATCH})
generate(libXrender ${CMAKE_CURRENT_SOURCE_DIR}/../libXrender/libXrender_interface.cpp ${GUEST_BITNESS})
add_host_lib(Xrender ${GUEST_BITNESS})
generate(libXfixes ${CMAKE_CURRENT_SOURCE_DIR}/../libXfixes/libXfixes_interface.cpp ${GUEST_BITNESS})
add_host_lib(Xfixes ${GUEST_BITNESS})
generate(libvulkan ${CMAKE_CURRENT_SOURCE_DIR}/../libvulkan/libvulkan_interface.cpp ${GUEST_BITNESS})
target_include_directories(libvulkan-${GUEST_BITNESS}-deps INTERFACE ${FEX_PROJECT_SOURCE_DIR}/External/Vulkan-Headers/include/)
add_host_lib(vulkan ${GUEST_BITNESS})
find_package(PkgConfig)
pkg_search_module(XCB REQUIRED xcb)
version_to_variables(${XCB_VERSION} XCB)
generate(libxcb ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb/libxcb_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb ${GUEST_BITNESS})
target_compile_definitions(libxcb-${GUEST_BITNESS}-deps INTERFACE -DXCB_VERSION_MAJOR=${XCB_VERSION_MAJOR})
target_compile_definitions(libxcb-${GUEST_BITNESS}-deps INTERFACE -DXCB_VERSION_MINOR=${XCB_VERSION_MINOR})
target_compile_definitions(libxcb-${GUEST_BITNESS}-deps INTERFACE -DXCB_VERSION_PATCH=${XCB_VERSION_PATCH})
generate(libxcb-dri2 ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-dri2/libxcb-dri2_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-dri2 ${GUEST_BITNESS})
generate(libxcb-dri3 ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-dri3/libxcb-dri3_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-dri3 ${GUEST_BITNESS})
generate(libxcb-xfixes ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-xfixes/libxcb-xfixes_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-xfixes ${GUEST_BITNESS})
generate(libxcb-shm ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-shm/libxcb-shm_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-shm ${GUEST_BITNESS})
generate(libxcb-sync ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-sync/libxcb-sync_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-sync ${GUEST_BITNESS})
generate(libxcb-present ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-present/libxcb-present_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-present ${GUEST_BITNESS})
generate(libxcb-randr ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-randr/libxcb-randr_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-randr ${GUEST_BITNESS})
generate(libxcb-glx ${CMAKE_CURRENT_SOURCE_DIR}/../libxcb-glx/libxcb-glx_interface.cpp ${GUEST_BITNESS})
add_host_lib(xcb-glx ${GUEST_BITNESS})
generate(libxshmfence ${CMAKE_CURRENT_SOURCE_DIR}/../libxshmfence/libxshmfence_interface.cpp ${GUEST_BITNESS})
add_host_lib(xshmfence ${GUEST_BITNESS})
generate(libdrm ${CMAKE_CURRENT_SOURCE_DIR}/../libdrm/libdrm_interface.cpp ${GUEST_BITNESS})
target_include_directories(libdrm-${GUEST_BITNESS}-deps INTERFACE /usr/include/drm/)
target_include_directories(libdrm-${GUEST_BITNESS}-deps INTERFACE /usr/include/libdrm/)
-25
View File
@@ -1,25 +0,0 @@
#pragma once
#include <array>
#include <string>
extern "C" {
#include <X11/Xlib.h>
}
namespace X11 {
constexpr static std::array<std::string_view, 13> CallbackKeys = {{
XNGeometryCallback,
XNDestroyCallback,
XNPreeditStartCallback,
XNPreeditDoneCallback,
XNPreeditDrawCallback,
XNPreeditCaretCallback,
XNPreeditStateNotifyCallback,
XNStatusStartCallback,
XNStatusDoneCallback,
XNStatusDrawCallback,
XNR6PreeditCallback,
XNStringConversionCallback,
}};
}
-359
View File
@@ -1,359 +0,0 @@
/*
$info$
tags: thunklibs|X11
desc: Handles callbacks and varargs
$end_info$
*/
extern "C" {
#define XUTIL_DEFINE_FUNCTIONS
#include <X11/Xlib.h>
#include <X11/Xutil.h>
#include <X11/Xresource.h>
#include <X11/Xproto.h>
#include <X11/XKBlib.h>
#include <X11/extensions/extutil.h>
// Include Xlibint.h and undefine some of its macros that clash with the standard library
#include <X11/Xlibint.h>
#undef min
#undef max
}
#include <algorithm>
#include <array>
#include <cassert>
#include <cstdint>
#include <stdio.h>
#include <cstring>
#include <map>
#include <list>
#include <string>
#include <unistd.h>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libX11.inl"
#include "X11Common.h"
// Custom implementations //
#include <vector>
namespace {
// The various X11 variadic functions take a flattened sequence of key:value pairs as arguments.
// The key element is a pointer to a string.
// The value element is a pointer to the data of that key type.
//
// Some keys describe function callbacks for various events that the server interface can call.
// FEX needs to walk these keys and ensure any callback function has a trampoline so the native
// X11 library can call it.
template<typename CallbackType>
static std::list<CallbackType> ConvertCallbackArguments(std::vector<void*>& IncomingArguments) {
assert(IncomingArguments.size() % 2 == 0 && "Incoming arguments needs to be in pairs");
std::list<CallbackType> Callbacks;
// Walk the arguments and convert any callbacks.
const size_t ArgumentPairs = IncomingArguments.size() / 2;
for (size_t i = 0; i < ArgumentPairs; ++i) {
const char* Key = static_cast<const char*>(IncomingArguments[i * 2]);
void** Data = &IncomingArguments[i * 2 + 1];
if (!*Data) {
continue;
}
// Check if the key is a callback and needs to be modified.
auto KeyIt = std::find(X11::CallbackKeys.begin(), X11::CallbackKeys.end(), Key);
if (KeyIt == X11::CallbackKeys.end()) {
continue;
}
// Key matches a callback, we need to wrap this.
CallbackType* IncomingCallback = reinterpret_cast<CallbackType*>(*Data);
CallbackType* ConvertedCallback = &Callbacks.emplace_back(CallbackType {
// Client data stays the same.
.client_data = IncomingCallback->client_data,
// Callback needs a trampoline.
.callback = AllocateHostTrampolineForGuestFunction(IncomingCallback->callback),
});
// Add this converted back in.
*Data = ConvertedCallback;
}
return Callbacks;
}
} // namespace
extern "C" {
char* XGetICValues(XIC ic, ...) {
fprintf(stderr, "XGetICValues\n");
va_list ap;
std::vector<void*> args;
va_start(ap, ic);
for (;;) {
auto arg = va_arg(ap, void*);
if (arg == 0) {
break;
}
args.push_back(arg);
fprintf(stderr, "%p\n", arg);
}
va_end(ap);
auto rv = fexfn_pack_XGetICValues_internal(ic, args.size(), &args[0]);
fprintf(stderr, "RV: %p\n", rv);
return rv;
}
char* XSetICValues(XIC ic, ...) {
fprintf(stderr, "XSetICValues\n");
va_list ap;
std::vector<void*> IncomingArguments;
va_start(ap, ic);
for (;;) {
auto Key = va_arg(ap, void*);
if (Key == 0) {
break;
}
auto Value = va_arg(ap, void*);
IncomingArguments.emplace_back(Key);
IncomingArguments.emplace_back(Value);
}
va_end(ap);
// Callback memory needs to live beyond internal function call.
std::list<XICCallback> Callbacks = ConvertCallbackArguments<XICCallback>(IncomingArguments);
auto rv = fexfn_pack_XSetICValues_internal(ic, IncomingArguments.size(), &IncomingArguments[0]);
fprintf(stderr, "RV: %p\n", rv);
return rv;
}
char* XGetIMValues(XIM ic, ...) {
fprintf(stderr, "XGetIMValues\n");
va_list ap;
std::vector<void*> args;
va_start(ap, ic);
for (;;) {
auto arg = va_arg(ap, void*);
if (arg == 0) {
break;
}
args.push_back(arg);
fprintf(stderr, "%p\n", arg);
}
va_end(ap);
auto rv = fexfn_pack_XGetIMValues_internal(ic, args.size(), &args[0]);
fprintf(stderr, "RV: %p\n", rv);
return rv;
}
char* XSetIMValues(XIM ic, ...) {
fprintf(stderr, "XSetIMValues\n");
va_list ap;
std::vector<void*> IncomingArguments;
va_start(ap, ic);
for (;;) {
auto Key = va_arg(ap, void*);
if (Key == 0) {
break;
}
auto Value = va_arg(ap, void*);
IncomingArguments.emplace_back(Key);
IncomingArguments.emplace_back(Value);
fprintf(stderr, "%s\n", (char*)Key);
}
va_end(ap);
// Callback memory needs to live beyond internal function call.
std::list<XIMCallback> Callbacks = ConvertCallbackArguments<XIMCallback>(IncomingArguments);
// Send a count (not including nullptr);
auto rv = fexfn_pack_XSetIMValues_internal(ic, IncomingArguments.size(), &IncomingArguments[0]);
fprintf(stderr, "RV: %p\n", rv);
return rv;
}
_XIC* XCreateIC(XIM im, ...) {
fprintf(stderr, "XCreateIC\n");
va_list ap;
std::vector<void*> IncomingArguments;
va_start(ap, im);
for (;;) {
auto Key = va_arg(ap, void*);
if (Key == 0) {
break;
}
auto Value = va_arg(ap, void*);
IncomingArguments.emplace_back(Key);
IncomingArguments.emplace_back(Value);
}
va_end(ap);
// Callback memory needs to live beyond internal function call.
std::list<XICCallback> Callbacks = ConvertCallbackArguments<XICCallback>(IncomingArguments);
auto rv = fexfn_pack_XCreateIC_internal(im, IncomingArguments.size(), &IncomingArguments[0]);
return rv;
}
XVaNestedList XVaCreateNestedList(int unused_arg, ...) {
fprintf(stderr, "XVaCreateNestedList\n");
va_list ap;
std::vector<void*> IncomingArguments;
va_start(ap, unused_arg);
for (;;) {
auto Key = va_arg(ap, void*);
if (Key == 0) {
break;
}
auto Value = va_arg(ap, void*);
IncomingArguments.emplace_back(Key);
IncomingArguments.emplace_back(Value);
}
va_end(ap);
// Callback memory needs to live beyond internal function call.
std::list<XICCallback> Callbacks = ConvertCallbackArguments<XICCallback>(IncomingArguments);
auto rv = fexfn_pack_XVaCreateNestedList_internal(unused_arg, IncomingArguments.size(), &IncomingArguments[0]);
fprintf(stderr, "RV: %p\n", rv);
return rv;
}
int XFree(void* ptr) {
// This function must be able to handle both guest heap pointers *and* host heap pointers,
// so it only forwards to the native host library for the latter.
//
// This is because Xlibint users allocate memory using internal macros aliasing to libc's
// malloc but then they free using the function XFree. For libX11, this is not a problem since
// the allocation happens in a thunked API function (and hence on the host heap), but if a
// function from an unthunked library accesses Xlibint, it will allocate on the guest heap.
//
// One notable example where this was encountered is XF86VidModeGetAllModeLines.
if (!ptr || IsHostHeapAllocation(ptr)) {
return fexfn_pack_XFree(ptr);
} else {
free(ptr);
return 1;
}
}
void XFreeEventData(Display* display, XGenericEventCookie* cookie) {
// Has the same heap-mismatch issue as XFree, so we have to reimplement it manually
if (_XIsEventCookie(display, (XEvent*)cookie) && cookie->data) {
XFree(cookie->data);
cookie->data = nullptr;
cookie->cookie = 0;
}
}
Display* XOpenDisplay(const char* name) {
auto ret = fexfn_pack_XOpenDisplay(name);
for (auto& funcptr : ret->event_vec) {
if (!funcptr) {
continue;
}
MakeHostFunctionGuestCallable(funcptr);
}
for (auto& funcptr : ret->wire_vec) {
if (!funcptr) {
continue;
}
MakeHostFunctionGuestCallable(funcptr);
}
MakeHostFunctionGuestCallable(ret->resource_alloc);
MakeHostFunctionGuestCallable(ret->idlist_alloc);
#if (X11_VERSION_MAJOR >= 1 && X11_VERSION_MINOR >= 7 && X11_VERSION_PATCH >= 0)
// Doesn't exist on older X11
MakeHostFunctionGuestCallable(ret->exit_handler);
#endif
return ret;
}
Status _XReply(Display* display, xReply* reply, int extra, Bool discard) {
for (auto handler = display->async_handlers; handler; handler = handler->next) {
// Make host-callable and overwrite in-place
// NOTE: This data seems to be stack-allocated specifically for XReply usually, so it's *probably* safe to overwrite
handler->handler = AllocateHostTrampolineForGuestFunction(handler->handler);
}
return fexfn_pack__XReply(display, reply, extra, discard);
}
static int _XInitDisplayLock(Display* display) {
MakeHostFunctionGuestCallable(display->lock_fns->lock_display);
MakeHostFunctionGuestCallable(display->lock_fns->unlock_display);
return 0;
}
Status XInitThreads() {
return fexfn_pack_XInitThreadsInternal((uintptr_t)_XInitDisplayLock, (uintptr_t)CallbackUnpack<decltype(_XInitDisplayLock)>::Unpack);
}
// Register the host function pointers written by _XInitImageFuncPtrs (and
// its callers) to be guest-callable
static void FixupImageFuncPtrs(XImage* image) {
image->f.create_image = XCreateImage;
MakeHostFunctionGuestCallable(image->f.destroy_image);
MakeHostFunctionGuestCallable(image->f.get_pixel);
MakeHostFunctionGuestCallable(image->f.put_pixel);
// TODO: image->f.sub_image
MakeHostFunctionGuestCallable(image->f.add_pixel);
}
void _XInitImageFuncPtrs(XImage* image) {
fexfn_pack__XInitImageFuncPtrs(image);
FixupImageFuncPtrs(image);
}
XImage* XCreateImage(Display* display, Visual* visual, unsigned int depth, int format, int offset, char* data, unsigned int width,
unsigned int height, int pad, int bpp) {
auto ret = fexfn_pack_XCreateImage(display, visual, depth, format, offset, data, width, height, pad, bpp);
FixupImageFuncPtrs(ret);
return ret;
}
Status XInitImage(XImage* image) {
auto ret = fexfn_pack_XInitImage(image);
FixupImageFuncPtrs(image);
return ret;
}
Bool XRegisterIMInstantiateCallback(Display* dpy, struct _XrmHashBucketRec* rdb, char* res_name, char* res_class, XIDProc callback,
XPointer client_data) {
return fexfn_pack_XRegisterIMInstantiateCallback(dpy, rdb, res_name, res_class, AllocateHostTrampolineForGuestFunction(callback), client_data);
}
Bool XUnregisterIMInstantiateCallback(Display* dpy, struct _XrmHashBucketRec* rdb, char* res_name, char* res_class, XIDProc callback,
XPointer client_data) {
return fexfn_pack_XUnregisterIMInstantiateCallback(dpy, rdb, res_name, res_class, AllocateHostTrampolineForGuestFunction(callback), client_data);
}
void (*_XLockMutex_fn)(LockInfoPtr) = nullptr;
void (*_XUnlockMutex_fn)(LockInfoPtr) = nullptr;
LockInfoPtr _Xglobal_lock = (LockInfoPtr)0x4142434445464748ULL;
}
LOAD_LIB(libX11)
File diff suppressed because it is too large. Load diff
File diff suppressed because it is too large. Load diff
-349
View File
@@ -1,349 +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 "thunkgen_guest_libxcb-dri2.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)
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-dri2
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/dri2.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-dri2.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);
}
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(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", 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_dri2)
@@ -1,151 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/dri2.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 0;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
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 {};
-220
View File
@@ -1,220 +0,0 @@
/*
$info$
tags: thunklibs|xcb-dri3
$end_info$
*/
#include <xcb/dri3.h>
#include <xcb/xcbext.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <string>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libxcb-dri3.inl"
extern "C" {
xcb_extension_t xcb_dri3_id = {
.name = "DRI3",
.global_id = 0,
};
void FEX_malloc_free_on_host(void* Ptr) {
struct {
void* p;
} args;
args.p = Ptr;
fexthunks_libxcb_dri3_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_dri3_FEX_usable_size(&args);
return args.rv;
}
static void InitializeExtensions(xcb_connection_t* c) {
FEX_xcb_dri3_init_extension(c, &xcb_dri3_id);
}
xcb_dri3_query_version_cookie_t xcb_dri3_query_version(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_dri3_query_version(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_dri3_query_version_cookie_t xcb_dri3_query_version_unchecked(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_dri3_query_version_unchecked(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_dri3_query_version_reply_t* xcb_dri3_query_version_reply(xcb_connection_t* a_0, xcb_dri3_query_version_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_dri3_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_dri3_open_reply_t* xcb_dri3_open_reply(xcb_connection_t* a_0, xcb_dri3_open_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_dri3_open_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_dri3_buffer_from_pixmap_reply_t*
xcb_dri3_buffer_from_pixmap_reply(xcb_connection_t* a_0, xcb_dri3_buffer_from_pixmap_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_dri3_buffer_from_pixmap_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_dri3_fd_from_fence_reply_t* xcb_dri3_fd_from_fence_reply(xcb_connection_t* a_0, xcb_dri3_fd_from_fence_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_dri3_fd_from_fence_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_dri3_get_supported_modifiers_reply_t*
xcb_dri3_get_supported_modifiers_reply(xcb_connection_t* a_0, xcb_dri3_get_supported_modifiers_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_dri3_get_supported_modifiers_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_dri3_buffers_from_pixmap_reply_t*
xcb_dri3_buffers_from_pixmap_reply(xcb_connection_t* a_0, xcb_dri3_buffers_from_pixmap_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_dri3_buffers_from_pixmap_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_dri3)
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-dri3
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/dri3.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-dri3.inl"
static void fexfn_impl_libxcb_dri3_FEX_xcb_dri3_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1);
static size_t fexfn_impl_libxcb_dri3_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_dri3_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_dri3_FEX_xcb_dri3_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "DRI3") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_dri3_so, "xcb_dri3_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_dri3)
@@ -1,119 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/dri3.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 0;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
void FEX_xcb_dri3_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_dri3_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_dri3_query_version> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_query_version_unchecked> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_query_version_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_open> {};
template<>
struct fex_gen_config<xcb_dri3_open_unchecked> {};
template<>
struct fex_gen_config<xcb_dri3_open_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_open_reply_fds> {};
template<>
struct fex_gen_config<xcb_dri3_pixmap_from_buffer_checked> {};
template<>
struct fex_gen_config<xcb_dri3_pixmap_from_buffer> {};
template<>
struct fex_gen_config<xcb_dri3_buffer_from_pixmap> {};
template<>
struct fex_gen_config<xcb_dri3_buffer_from_pixmap_unchecked> {};
template<>
struct fex_gen_config<xcb_dri3_buffer_from_pixmap_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_buffer_from_pixmap_reply_fds> {};
template<>
struct fex_gen_config<xcb_dri3_fence_from_fd_checked> {};
template<>
struct fex_gen_config<xcb_dri3_fence_from_fd> {};
template<>
struct fex_gen_config<xcb_dri3_fd_from_fence> {};
template<>
struct fex_gen_config<xcb_dri3_fd_from_fence_unchecked> {};
template<>
struct fex_gen_config<xcb_dri3_fd_from_fence_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_fd_from_fence_reply_fds> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_sizeof> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_unchecked> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_window_modifiers> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_window_modifiers_length> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_window_modifiers_end> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_screen_modifiers> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_screen_modifiers_length> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_screen_modifiers_end> {};
template<>
struct fex_gen_config<xcb_dri3_get_supported_modifiers_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_pixmap_from_buffers_checked> {};
template<>
struct fex_gen_config<xcb_dri3_pixmap_from_buffers> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_sizeof> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_unchecked> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_strides> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_strides_length> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_strides_end> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_offsets> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_offsets_length> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_offsets_end> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_buffers> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_buffers_length> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_buffers_end> {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_dri3_buffers_from_pixmap_reply_fds> {};
File diff suppressed because it is too large. Load diff
-50
View File
@@ -1,50 +0,0 @@
/*
$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)
File diff suppressed because it is too large. Load diff
-115
View File
@@ -1,115 +0,0 @@
/*
$info$
tags: thunklibs|xcb-present
$end_info$
*/
#include <xcb/present.h>
#include <xcb/xcbext.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <string>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libxcb-present.inl"
extern "C" {
xcb_extension_t xcb_present_id = {
.name = "Present",
.global_id = 0,
};
void FEX_malloc_free_on_host(void* Ptr) {
struct {
void* p;
} args;
args.p = Ptr;
fexthunks_libxcb_present_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_present_FEX_usable_size(&args);
return args.rv;
}
static void InitializeExtensions(xcb_connection_t* c) {
FEX_xcb_present_init_extension(c, &xcb_present_id);
}
xcb_present_query_version_cookie_t xcb_present_query_version(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_present_query_version(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_present_query_version_cookie_t xcb_present_query_version_unchecked(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_present_query_version_unchecked(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_present_query_version_reply_t*
xcb_present_query_version_reply(xcb_connection_t* a_0, xcb_present_query_version_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_present_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_present_query_capabilities_reply_t*
xcb_present_query_capabilities_reply(xcb_connection_t* a_0, xcb_present_query_capabilities_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_present_query_capabilities_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_present)
-50
View File
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-present
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/present.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-present.inl"
static void fexfn_impl_libxcb_present_FEX_xcb_present_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1);
static size_t fexfn_impl_libxcb_present_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_present_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_present_FEX_xcb_present_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "Present") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_present_so, "xcb_present_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_present)
@@ -1,76 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/present.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 0;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
void FEX_xcb_present_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_present_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_present_notify_next> {};
template<>
struct fex_gen_config<xcb_present_notify_end> {};
template<>
struct fex_gen_config<xcb_present_query_version> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_present_query_version_unchecked> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_present_query_version_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_present_pixmap_sizeof> {};
template<>
struct fex_gen_config<xcb_present_pixmap_checked> {};
template<>
struct fex_gen_config<xcb_present_pixmap> {};
template<>
struct fex_gen_config<xcb_present_pixmap_notifies> {};
template<>
struct fex_gen_config<xcb_present_pixmap_notifies_length> {};
template<>
struct fex_gen_config<xcb_present_pixmap_notifies_iterator> {};
template<>
struct fex_gen_config<xcb_present_notify_msc_checked> {};
template<>
struct fex_gen_config<xcb_present_notify_msc> {};
template<>
struct fex_gen_config<xcb_present_event_next> {};
template<>
struct fex_gen_config<xcb_present_event_end> {};
template<>
struct fex_gen_config<xcb_present_select_input_checked> {};
template<>
struct fex_gen_config<xcb_present_select_input> {};
template<>
struct fex_gen_config<xcb_present_query_capabilities> {};
template<>
struct fex_gen_config<xcb_present_query_capabilities_unchecked> {};
template<>
struct fex_gen_config<xcb_present_query_capabilities_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_present_redirect_notify_sizeof> {};
template<>
struct fex_gen_config<xcb_present_redirect_notify_notifies> {};
template<>
struct fex_gen_config<xcb_present_redirect_notify_notifies_length> {};
template<>
struct fex_gen_config<xcb_present_redirect_notify_notifies_iterator> {};
-806
View File
@@ -1,806 +0,0 @@
/*
$info$
tags: thunklibs|xcb-randr
$end_info$
*/
#include <xcb/randr.h>
#include <xcb/xcbext.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <string>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libxcb-randr.inl"
extern "C" {
xcb_extension_t xcb_randr_id = {
.name = "RANDR",
.global_id = 0,
};
static void InitializeExtensions(xcb_connection_t* c) {
FEX_xcb_randr_init_extension(c, &xcb_randr_id);
}
void FEX_malloc_free_on_host(void* Ptr) {
struct {
void* p;
} args;
args.p = Ptr;
fexthunks_libxcb_randr_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_randr_FEX_usable_size(&args);
return args.rv;
}
xcb_randr_query_version_cookie_t xcb_randr_query_version(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_randr_query_version(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_randr_query_version_cookie_t xcb_randr_query_version_unchecked(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_randr_query_version_unchecked(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_randr_query_version_reply_t*
xcb_randr_query_version_reply(xcb_connection_t* a_0, xcb_randr_query_version_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_set_screen_config_reply_t*
xcb_randr_set_screen_config_reply(xcb_connection_t* a_0, xcb_randr_set_screen_config_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_set_screen_config_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_screen_size_range_reply_t*
xcb_randr_get_screen_size_range_reply(xcb_connection_t* a_0, xcb_randr_get_screen_size_range_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_screen_size_range_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_screen_resources_reply_t*
xcb_randr_get_screen_resources_reply(xcb_connection_t* a_0, xcb_randr_get_screen_resources_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_screen_resources_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_output_info_reply_t*
xcb_randr_get_output_info_reply(xcb_connection_t* a_0, xcb_randr_get_output_info_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_output_info_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_list_output_properties_reply_t*
xcb_randr_list_output_properties_reply(xcb_connection_t* a_0, xcb_randr_list_output_properties_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_list_output_properties_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_query_output_property_reply_t*
xcb_randr_query_output_property_reply(xcb_connection_t* a_0, xcb_randr_query_output_property_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_query_output_property_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_output_property_reply_t*
xcb_randr_get_output_property_reply(xcb_connection_t* a_0, xcb_randr_get_output_property_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_output_property_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_create_mode_reply_t* xcb_randr_create_mode_reply(xcb_connection_t* a_0, xcb_randr_create_mode_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_create_mode_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_crtc_info_reply_t*
xcb_randr_get_crtc_info_reply(xcb_connection_t* a_0, xcb_randr_get_crtc_info_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_crtc_info_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_set_crtc_config_reply_t*
xcb_randr_set_crtc_config_reply(xcb_connection_t* a_0, xcb_randr_set_crtc_config_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_set_crtc_config_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_crtc_gamma_size_reply_t*
xcb_randr_get_crtc_gamma_size_reply(xcb_connection_t* a_0, xcb_randr_get_crtc_gamma_size_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_crtc_gamma_size_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_crtc_gamma_reply_t*
xcb_randr_get_crtc_gamma_reply(xcb_connection_t* a_0, xcb_randr_get_crtc_gamma_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_crtc_gamma_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_screen_resources_current_reply_t* xcb_randr_get_screen_resources_current_reply(
xcb_connection_t* a_0, xcb_randr_get_screen_resources_current_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_screen_resources_current_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_crtc_transform_reply_t*
xcb_randr_get_crtc_transform_reply(xcb_connection_t* a_0, xcb_randr_get_crtc_transform_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_crtc_transform_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_panning_reply_t* xcb_randr_get_panning_reply(xcb_connection_t* a_0, xcb_randr_get_panning_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_panning_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_set_panning_reply_t* xcb_randr_set_panning_reply(xcb_connection_t* a_0, xcb_randr_set_panning_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_set_panning_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_output_primary_reply_t*
xcb_randr_get_output_primary_reply(xcb_connection_t* a_0, xcb_randr_get_output_primary_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_output_primary_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_providers_reply_t*
xcb_randr_get_providers_reply(xcb_connection_t* a_0, xcb_randr_get_providers_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_providers_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_provider_info_reply_t*
xcb_randr_get_provider_info_reply(xcb_connection_t* a_0, xcb_randr_get_provider_info_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_provider_info_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_list_provider_properties_reply_t*
xcb_randr_list_provider_properties_reply(xcb_connection_t* a_0, xcb_randr_list_provider_properties_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_list_provider_properties_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_query_provider_property_reply_t*
xcb_randr_query_provider_property_reply(xcb_connection_t* a_0, xcb_randr_query_provider_property_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_query_provider_property_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_provider_property_reply_t*
xcb_randr_get_provider_property_reply(xcb_connection_t* a_0, xcb_randr_get_provider_property_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_provider_property_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_get_monitors_reply_t* xcb_randr_get_monitors_reply(xcb_connection_t* a_0, xcb_randr_get_monitors_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_get_monitors_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
xcb_randr_create_lease_reply_t* xcb_randr_create_lease_reply(xcb_connection_t* a_0, xcb_randr_create_lease_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_randr_create_lease_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) {
// Usable size
size_t Usable = FEX_malloc_usable_size(ret);
// This will be a bit wasteful but this is an unsized pointer
void* NewPtr = malloc(Usable);
memcpy(NewPtr, ret, Usable);
FEX_malloc_free_on_host(ret);
ret = (decltype(ret))NewPtr;
}
return ret;
}
}
LOAD_LIB(libxcb_randr)
-50
View File
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-randr
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/randr.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-randr.inl"
static void fexfn_impl_libxcb_randr_FEX_xcb_randr_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1);
static size_t fexfn_impl_libxcb_randr_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_randr_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_randr_FEX_xcb_randr_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "RANDR") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_randr_so, "xcb_randr_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_randr)
@@ -1,694 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/randr.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 0;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
// Union type (includes pointers, so only compatible across 64-bit architectures)
#ifndef IS_32BIT_THUNK
template<>
struct fex_gen_type<xcb_randr_notify_data_t> : fexgen::assume_compatible_data_layout {};
#endif
void FEX_xcb_randr_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_randr_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_randr_mode_next> {};
template<>
struct fex_gen_config<xcb_randr_mode_end> {};
template<>
struct fex_gen_config<xcb_randr_crtc_next> {};
template<>
struct fex_gen_config<xcb_randr_crtc_end> {};
template<>
struct fex_gen_config<xcb_randr_output_next> {};
template<>
struct fex_gen_config<xcb_randr_output_end> {};
template<>
struct fex_gen_config<xcb_randr_provider_next> {};
template<>
struct fex_gen_config<xcb_randr_provider_end> {};
template<>
struct fex_gen_config<xcb_randr_lease_next> {};
template<>
struct fex_gen_config<xcb_randr_lease_end> {};
template<>
struct fex_gen_config<xcb_randr_screen_size_next> {};
template<>
struct fex_gen_config<xcb_randr_screen_size_end> {};
template<>
struct fex_gen_config<xcb_randr_refresh_rates_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_refresh_rates_rates> {};
template<>
struct fex_gen_config<xcb_randr_refresh_rates_rates_length> {};
template<>
struct fex_gen_config<xcb_randr_refresh_rates_rates_end> {};
template<>
struct fex_gen_config<xcb_randr_refresh_rates_next> {};
template<>
struct fex_gen_config<xcb_randr_refresh_rates_end> {};
template<>
struct fex_gen_config<xcb_randr_query_version> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_query_version_unchecked> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_query_version_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_screen_config> {};
template<>
struct fex_gen_config<xcb_randr_set_screen_config_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_set_screen_config_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_select_input_checked> {};
template<>
struct fex_gen_config<xcb_randr_select_input> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_sizes> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_sizes_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_sizes_iterator> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_rates_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_rates_iterator> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_info_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_screen_size_range> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_size_range_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_size_range_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_screen_size_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_screen_size> {};
template<>
struct fex_gen_config<xcb_randr_mode_info_next> {};
template<>
struct fex_gen_config<xcb_randr_mode_info_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_crtcs> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_crtcs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_crtcs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_outputs> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_outputs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_outputs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_modes> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_modes_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_modes_iterator> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_names> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_names_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_names_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_crtcs> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_crtcs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_crtcs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_modes> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_modes_length> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_modes_end> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_clones> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_clones_length> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_clones_end> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_name> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_name_length> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_name_end> {};
template<>
struct fex_gen_config<xcb_randr_get_output_info_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties> {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties_atoms> {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties_atoms_length> {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties_atoms_end> {};
template<>
struct fex_gen_config<xcb_randr_list_output_properties_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_query_output_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_query_output_property> {};
template<>
struct fex_gen_config<xcb_randr_query_output_property_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_query_output_property_valid_values> {};
template<>
struct fex_gen_config<xcb_randr_query_output_property_valid_values_length> {};
template<>
struct fex_gen_config<xcb_randr_query_output_property_valid_values_end> {};
template<>
struct fex_gen_config<xcb_randr_query_output_property_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_configure_output_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_configure_output_property_checked> {};
template<>
struct fex_gen_config<xcb_randr_configure_output_property> {};
template<>
struct fex_gen_config<xcb_randr_configure_output_property_values> {};
template<>
struct fex_gen_config<xcb_randr_configure_output_property_values_length> {};
template<>
struct fex_gen_config<xcb_randr_configure_output_property_values_end> {};
template<>
struct fex_gen_config<xcb_randr_change_output_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_change_output_property_checked> {};
template<>
struct fex_gen_config<xcb_randr_change_output_property> {};
template<>
struct fex_gen_config<xcb_randr_change_output_property_data> {};
template<>
struct fex_gen_config<xcb_randr_change_output_property_data_length> {};
template<>
struct fex_gen_config<xcb_randr_change_output_property_data_end> {};
template<>
struct fex_gen_config<xcb_randr_delete_output_property_checked> {};
template<>
struct fex_gen_config<xcb_randr_delete_output_property> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property_data> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property_data_length> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property_data_end> {};
template<>
struct fex_gen_config<xcb_randr_get_output_property_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_create_mode_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_create_mode> {};
template<>
struct fex_gen_config<xcb_randr_create_mode_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_create_mode_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_destroy_mode_checked> {};
template<>
struct fex_gen_config<xcb_randr_destroy_mode> {};
template<>
struct fex_gen_config<xcb_randr_add_output_mode_checked> {};
template<>
struct fex_gen_config<xcb_randr_add_output_mode> {};
template<>
struct fex_gen_config<xcb_randr_delete_output_mode_checked> {};
template<>
struct fex_gen_config<xcb_randr_delete_output_mode> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_outputs> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_outputs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_outputs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_possible> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_possible_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_possible_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_info_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_config_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_config> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_config_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_config_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_size> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_size_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_size_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_red> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_red_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_red_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_green> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_green_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_green_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_blue> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_blue_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_blue_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_gamma_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_red> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_red_length> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_red_end> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_green> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_green_length> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_green_end> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_blue> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_blue_length> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_gamma_blue_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_crtcs> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_crtcs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_crtcs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_outputs> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_outputs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_outputs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_modes> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_modes_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_modes_iterator> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_names> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_names_length> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_names_end> {};
template<>
struct fex_gen_config<xcb_randr_get_screen_resources_current_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_filter_name> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_filter_name_length> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_filter_name_end> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_filter_params> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_filter_params_length> {};
template<>
struct fex_gen_config<xcb_randr_set_crtc_transform_filter_params_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_pending_filter_name> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_pending_filter_name_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_pending_filter_name_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_pending_params> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_pending_params_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_pending_params_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_current_filter_name> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_current_filter_name_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_current_filter_name_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_current_params> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_current_params_length> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_current_params_end> {};
template<>
struct fex_gen_config<xcb_randr_get_crtc_transform_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_panning> {};
template<>
struct fex_gen_config<xcb_randr_get_panning_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_panning_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_panning> {};
template<>
struct fex_gen_config<xcb_randr_set_panning_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_set_panning_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_output_primary_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_output_primary> {};
template<>
struct fex_gen_config<xcb_randr_get_output_primary> {};
template<>
struct fex_gen_config<xcb_randr_get_output_primary_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_output_primary_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_providers_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_providers> {};
template<>
struct fex_gen_config<xcb_randr_get_providers_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_providers_providers> {};
template<>
struct fex_gen_config<xcb_randr_get_providers_providers_length> {};
template<>
struct fex_gen_config<xcb_randr_get_providers_providers_end> {};
template<>
struct fex_gen_config<xcb_randr_get_providers_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_crtcs> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_crtcs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_crtcs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_outputs> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_outputs_length> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_outputs_end> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_associated_providers> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_associated_providers_length> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_associated_providers_end> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_associated_capability> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_associated_capability_length> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_associated_capability_end> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_name> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_name_length> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_name_end> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_info_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_provider_offload_sink_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_provider_offload_sink> {};
template<>
struct fex_gen_config<xcb_randr_set_provider_output_source_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_provider_output_source> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties_atoms> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties_atoms_length> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties_atoms_end> {};
template<>
struct fex_gen_config<xcb_randr_list_provider_properties_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property> {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property_valid_values> {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property_valid_values_length> {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property_valid_values_end> {};
template<>
struct fex_gen_config<xcb_randr_query_provider_property_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_configure_provider_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_configure_provider_property_checked> {};
template<>
struct fex_gen_config<xcb_randr_configure_provider_property> {};
template<>
struct fex_gen_config<xcb_randr_configure_provider_property_values> {};
template<>
struct fex_gen_config<xcb_randr_configure_provider_property_values_length> {};
template<>
struct fex_gen_config<xcb_randr_configure_provider_property_values_end> {};
template<>
struct fex_gen_config<xcb_randr_change_provider_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_change_provider_property_checked> {};
template<>
struct fex_gen_config<xcb_randr_change_provider_property> {};
template<>
struct fex_gen_config<xcb_randr_change_provider_property_data> {};
template<>
struct fex_gen_config<xcb_randr_change_provider_property_data_length> {};
template<>
struct fex_gen_config<xcb_randr_change_provider_property_data_end> {};
template<>
struct fex_gen_config<xcb_randr_delete_provider_property_checked> {};
template<>
struct fex_gen_config<xcb_randr_delete_provider_property> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property_data> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property_data_length> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property_data_end> {};
template<>
struct fex_gen_config<xcb_randr_get_provider_property_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_crtc_change_next> {};
template<>
struct fex_gen_config<xcb_randr_crtc_change_end> {};
template<>
struct fex_gen_config<xcb_randr_output_change_next> {};
template<>
struct fex_gen_config<xcb_randr_output_change_end> {};
template<>
struct fex_gen_config<xcb_randr_output_property_next> {};
template<>
struct fex_gen_config<xcb_randr_output_property_end> {};
template<>
struct fex_gen_config<xcb_randr_provider_change_next> {};
template<>
struct fex_gen_config<xcb_randr_provider_change_end> {};
template<>
struct fex_gen_config<xcb_randr_provider_property_next> {};
template<>
struct fex_gen_config<xcb_randr_provider_property_end> {};
template<>
struct fex_gen_config<xcb_randr_resource_change_next> {};
template<>
struct fex_gen_config<xcb_randr_resource_change_end> {};
template<>
struct fex_gen_config<xcb_randr_monitor_info_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_monitor_info_outputs> {};
template<>
struct fex_gen_config<xcb_randr_monitor_info_outputs_length> {};
template<>
struct fex_gen_config<xcb_randr_monitor_info_outputs_end> {};
template<>
struct fex_gen_config<xcb_randr_monitor_info_next> {};
template<>
struct fex_gen_config<xcb_randr_monitor_info_end> {};
template<>
struct fex_gen_config<xcb_randr_get_monitors_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_get_monitors> {};
template<>
struct fex_gen_config<xcb_randr_get_monitors_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_get_monitors_monitors_length> {};
template<>
struct fex_gen_config<xcb_randr_get_monitors_monitors_iterator> {};
template<>
struct fex_gen_config<xcb_randr_get_monitors_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_set_monitor_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_set_monitor_checked> {};
template<>
struct fex_gen_config<xcb_randr_set_monitor> {};
template<>
struct fex_gen_config<xcb_randr_set_monitor_monitorinfo> {};
template<>
struct fex_gen_config<xcb_randr_delete_monitor_checked> {};
template<>
struct fex_gen_config<xcb_randr_delete_monitor> {};
template<>
struct fex_gen_config<xcb_randr_create_lease_sizeof> {};
template<>
struct fex_gen_config<xcb_randr_create_lease> {};
template<>
struct fex_gen_config<xcb_randr_create_lease_unchecked> {};
template<>
struct fex_gen_config<xcb_randr_create_lease_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_randr_create_lease_reply_fds> {};
template<>
struct fex_gen_config<xcb_randr_free_lease_checked> {};
template<>
struct fex_gen_config<xcb_randr_free_lease> {};
template<>
struct fex_gen_config<xcb_randr_lease_notify_next> {};
template<>
struct fex_gen_config<xcb_randr_lease_notify_end> {};
template<>
struct fex_gen_config<xcb_randr_notify_data_next> {};
template<>
struct fex_gen_config<xcb_randr_notify_data_end> {};
-140
View File
@@ -1,140 +0,0 @@
/*
$info$
tags: thunklibs|xcb-shm
$end_info$
*/
#include <xcb/shm.h>
#include <xcb/xcbext.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <string>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libxcb-shm.inl"
extern "C" {
xcb_extension_t xcb_shm_id = {
.name = "MIT-SHM",
.global_id = 0,
};
void FEX_malloc_free_on_host(void* Ptr) {
struct {
void* p;
} args;
args.p = Ptr;
fexthunks_libxcb_shm_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_shm_FEX_usable_size(&args);
return args.rv;
}
static void InitializeExtensions(xcb_connection_t* c) {
FEX_xcb_shm_init_extension(c, &xcb_shm_id);
}
xcb_shm_query_version_cookie_t xcb_shm_query_version(xcb_connection_t* a_0) {
auto ret = fexfn_pack_xcb_shm_query_version(a_0);
InitializeExtensions(a_0);
return ret;
}
xcb_shm_query_version_cookie_t xcb_shm_query_version_unchecked(xcb_connection_t* a_0) {
auto ret = fexfn_pack_xcb_shm_query_version_unchecked(a_0);
InitializeExtensions(a_0);
return ret;
}
xcb_shm_query_version_reply_t* xcb_shm_query_version_reply(xcb_connection_t* a_0, xcb_shm_query_version_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_shm_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_shm_get_image_reply_t* xcb_shm_get_image_reply(xcb_connection_t* a_0, xcb_shm_get_image_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_shm_get_image_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_shm_create_segment_reply_t* xcb_shm_create_segment_reply(xcb_connection_t* a_0, xcb_shm_create_segment_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_shm_create_segment_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_shm)
-50
View File
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-shm
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/shm.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-shm.inl"
static void fexfn_impl_libxcb_shm_FEX_xcb_shm_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1);
static size_t fexfn_impl_libxcb_shm_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_shm_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_shm_FEX_xcb_shm_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "MIT-SHM") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_shm_so, "xcb_shm_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_shm)
@@ -1,71 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/shm.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 0;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
void FEX_xcb_shm_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_shm_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_shm_seg_next> {};
template<>
struct fex_gen_config<xcb_shm_seg_end> {};
template<>
struct fex_gen_config<xcb_shm_query_version> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_shm_query_version_unchecked> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_shm_query_version_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_shm_attach_checked> {};
template<>
struct fex_gen_config<xcb_shm_attach> {};
template<>
struct fex_gen_config<xcb_shm_detach_checked> {};
template<>
struct fex_gen_config<xcb_shm_detach> {};
template<>
struct fex_gen_config<xcb_shm_put_image_checked> {};
template<>
struct fex_gen_config<xcb_shm_put_image> {};
template<>
struct fex_gen_config<xcb_shm_get_image> {};
template<>
struct fex_gen_config<xcb_shm_get_image_unchecked> {};
template<>
struct fex_gen_config<xcb_shm_get_image_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_shm_create_pixmap_checked> {};
template<>
struct fex_gen_config<xcb_shm_create_pixmap> {};
template<>
struct fex_gen_config<xcb_shm_attach_fd_checked> {};
template<>
struct fex_gen_config<xcb_shm_attach_fd> {};
template<>
struct fex_gen_config<xcb_shm_create_segment> {};
template<>
struct fex_gen_config<xcb_shm_create_segment_unchecked> {};
template<>
struct fex_gen_config<xcb_shm_create_segment_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_shm_create_segment_reply_fds> {};
-217
View File
@@ -1,217 +0,0 @@
/*
$info$
tags: thunklibs|xcb-sync
$end_info$
*/
#include <xcb/sync.h>
#include <xcb/xcbext.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <string>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libxcb-sync.inl"
extern "C" {
xcb_extension_t xcb_sync_id = {
.name = "SYNC",
.global_id = 0,
};
void FEX_malloc_free_on_host(void* Ptr) {
struct {
void* p;
} args;
args.p = Ptr;
fexthunks_libxcb_sync_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_sync_FEX_usable_size(&args);
return args.rv;
}
static void InitializeExtensions(xcb_connection_t* c) {
FEX_xcb_sync_init_extension(c, &xcb_sync_id);
}
xcb_sync_initialize_cookie_t xcb_sync_initialize(xcb_connection_t* a_0, uint8_t a_1, uint8_t a_2) {
auto ret = fexfn_pack_xcb_sync_initialize(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_sync_initialize_cookie_t xcb_sync_initialize_unchecked(xcb_connection_t* a_0, uint8_t a_1, uint8_t a_2) {
auto ret = fexfn_pack_xcb_sync_initialize_unchecked(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_sync_initialize_reply_t* xcb_sync_initialize_reply(xcb_connection_t* a_0, xcb_sync_initialize_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_sync_initialize_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_sync_list_system_counters_reply_t*
xcb_sync_list_system_counters_reply(xcb_connection_t* a_0, xcb_sync_list_system_counters_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_sync_list_system_counters_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_sync_query_counter_reply_t* xcb_sync_query_counter_reply(xcb_connection_t* a_0, xcb_sync_query_counter_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_sync_query_counter_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_sync_query_alarm_reply_t* xcb_sync_query_alarm_reply(xcb_connection_t* a_0, xcb_sync_query_alarm_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_sync_query_alarm_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_sync_get_priority_reply_t* xcb_sync_get_priority_reply(xcb_connection_t* a_0, xcb_sync_get_priority_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_sync_get_priority_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_sync_query_fence_reply_t* xcb_sync_query_fence_reply(xcb_connection_t* a_0, xcb_sync_query_fence_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_sync_query_fence_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_sync)
-50
View File
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-sync
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/sync.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-sync.inl"
static void fexfn_impl_libxcb_sync_FEX_xcb_sync_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1);
static size_t fexfn_impl_libxcb_sync_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_sync_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_sync_FEX_xcb_sync_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "SYNC") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_sync_so, "xcb_sync_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_sync)
@@ -1,206 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/sync.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 1;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
void FEX_xcb_sync_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_sync_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_sync_alarm_next> {};
template<>
struct fex_gen_config<xcb_sync_alarm_end> {};
template<>
struct fex_gen_config<xcb_sync_counter_next> {};
template<>
struct fex_gen_config<xcb_sync_counter_end> {};
template<>
struct fex_gen_config<xcb_sync_fence_next> {};
template<>
struct fex_gen_config<xcb_sync_fence_end> {};
template<>
struct fex_gen_config<xcb_sync_int64_next> {};
template<>
struct fex_gen_config<xcb_sync_int64_end> {};
template<>
struct fex_gen_config<xcb_sync_systemcounter_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_systemcounter_name> {};
template<>
struct fex_gen_config<xcb_sync_systemcounter_name_length> {};
template<>
struct fex_gen_config<xcb_sync_systemcounter_name_end> {};
template<>
struct fex_gen_config<xcb_sync_systemcounter_next> {};
template<>
struct fex_gen_config<xcb_sync_systemcounter_end> {};
template<>
struct fex_gen_config<xcb_sync_trigger_next> {};
template<>
struct fex_gen_config<xcb_sync_trigger_end> {};
template<>
struct fex_gen_config<xcb_sync_waitcondition_next> {};
template<>
struct fex_gen_config<xcb_sync_waitcondition_end> {};
template<>
struct fex_gen_config<xcb_sync_initialize> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_initialize_unchecked> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_initialize_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_list_system_counters_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_list_system_counters> {};
template<>
struct fex_gen_config<xcb_sync_list_system_counters_unchecked> {};
template<>
struct fex_gen_config<xcb_sync_list_system_counters_counters_length> {};
template<>
struct fex_gen_config<xcb_sync_list_system_counters_counters_iterator> {};
template<>
struct fex_gen_config<xcb_sync_list_system_counters_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_create_counter_checked> {};
template<>
struct fex_gen_config<xcb_sync_create_counter> {};
template<>
struct fex_gen_config<xcb_sync_destroy_counter_checked> {};
template<>
struct fex_gen_config<xcb_sync_destroy_counter> {};
template<>
struct fex_gen_config<xcb_sync_query_counter> {};
template<>
struct fex_gen_config<xcb_sync_query_counter_unchecked> {};
template<>
struct fex_gen_config<xcb_sync_query_counter_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_await_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_await_checked> {};
template<>
struct fex_gen_config<xcb_sync_await> {};
template<>
struct fex_gen_config<xcb_sync_await_wait_list> {};
template<>
struct fex_gen_config<xcb_sync_await_wait_list_length> {};
template<>
struct fex_gen_config<xcb_sync_await_wait_list_iterator> {};
template<>
struct fex_gen_config<xcb_sync_change_counter_checked> {};
template<>
struct fex_gen_config<xcb_sync_change_counter> {};
template<>
struct fex_gen_config<xcb_sync_set_counter_checked> {};
template<>
struct fex_gen_config<xcb_sync_set_counter> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_value_list_serialize> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_value_list_unpack> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_value_list_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_checked> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_aux_checked> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_aux> {};
template<>
struct fex_gen_config<xcb_sync_create_alarm_value_list> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_value_list_serialize> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_value_list_unpack> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_value_list_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_checked> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_aux_checked> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_aux> {};
template<>
struct fex_gen_config<xcb_sync_change_alarm_value_list> {};
template<>
struct fex_gen_config<xcb_sync_destroy_alarm_checked> {};
template<>
struct fex_gen_config<xcb_sync_destroy_alarm> {};
template<>
struct fex_gen_config<xcb_sync_query_alarm> {};
template<>
struct fex_gen_config<xcb_sync_query_alarm_unchecked> {};
template<>
struct fex_gen_config<xcb_sync_query_alarm_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_set_priority_checked> {};
template<>
struct fex_gen_config<xcb_sync_set_priority> {};
template<>
struct fex_gen_config<xcb_sync_get_priority> {};
template<>
struct fex_gen_config<xcb_sync_get_priority_unchecked> {};
template<>
struct fex_gen_config<xcb_sync_get_priority_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_create_fence_checked> {};
template<>
struct fex_gen_config<xcb_sync_create_fence> {};
template<>
struct fex_gen_config<xcb_sync_trigger_fence_checked> {};
template<>
struct fex_gen_config<xcb_sync_trigger_fence> {};
template<>
struct fex_gen_config<xcb_sync_reset_fence_checked> {};
template<>
struct fex_gen_config<xcb_sync_reset_fence> {};
template<>
struct fex_gen_config<xcb_sync_destroy_fence_checked> {};
template<>
struct fex_gen_config<xcb_sync_destroy_fence> {};
template<>
struct fex_gen_config<xcb_sync_query_fence> {};
template<>
struct fex_gen_config<xcb_sync_query_fence_unchecked> {};
template<>
struct fex_gen_config<xcb_sync_query_fence_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_sync_await_fence_sizeof> {};
template<>
struct fex_gen_config<xcb_sync_await_fence_checked> {};
template<>
struct fex_gen_config<xcb_sync_await_fence> {};
template<>
struct fex_gen_config<xcb_sync_await_fence_fence_list> {};
template<>
struct fex_gen_config<xcb_sync_await_fence_fence_list_length> {};
template<>
struct fex_gen_config<xcb_sync_await_fence_fence_list_end> {};
@@ -1,196 +0,0 @@
/*
$info$
tags: thunklibs|xcb-xfixes
$end_info$
*/
#include <xcb/xfixes.h>
#include <xcb/xcbext.h>
#include <stdio.h>
#include <cstring>
#include <map>
#include <string>
#include "common/Guest.h"
#include <stdarg.h>
#include "thunkgen_guest_libxcb-xfixes.inl"
extern "C" {
xcb_extension_t xcb_xfixes_id = {
.name = "XFIXES",
.global_id = 0,
};
void FEX_malloc_free_on_host(void* Ptr) {
struct {
void* p;
} args;
args.p = Ptr;
fexthunks_libxcb_xfixes_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_xfixes_FEX_usable_size(&args);
return args.rv;
}
static void InitializeExtensions(xcb_connection_t* c) {
FEX_xcb_xfixes_init_extension(c, &xcb_xfixes_id);
}
xcb_xfixes_query_version_cookie_t xcb_xfixes_query_version(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_xfixes_query_version(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_xfixes_query_version_cookie_t xcb_xfixes_query_version_unchecked(xcb_connection_t* a_0, uint32_t a_1, uint32_t a_2) {
auto ret = fexfn_pack_xcb_xfixes_query_version_unchecked(a_0, a_1, a_2);
InitializeExtensions(a_0);
return ret;
}
xcb_xfixes_query_version_reply_t*
xcb_xfixes_query_version_reply(xcb_connection_t* a_0, xcb_xfixes_query_version_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_xfixes_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_xfixes_get_cursor_image_reply_t*
xcb_xfixes_get_cursor_image_reply(xcb_connection_t* a_0, xcb_xfixes_get_cursor_image_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_xfixes_get_cursor_image_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_xfixes_fetch_region_reply_t*
xcb_xfixes_fetch_region_reply(xcb_connection_t* a_0, xcb_xfixes_fetch_region_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_xfixes_fetch_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_xfixes_get_cursor_name_reply_t*
xcb_xfixes_get_cursor_name_reply(xcb_connection_t* a_0, xcb_xfixes_get_cursor_name_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_xfixes_get_cursor_name_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_xfixes_get_cursor_image_and_name_reply_t* xcb_xfixes_get_cursor_image_and_name_reply(
xcb_connection_t* a_0, xcb_xfixes_get_cursor_image_and_name_cookie_t a_1, xcb_generic_error_t** a_2) {
auto ret = fexfn_pack_xcb_xfixes_get_cursor_image_and_name_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_xfixes)
@@ -1,50 +0,0 @@
/*
$info$
tags: thunklibs|xcb-xfixes
$end_info$
*/
#include <cstring>
#include <stdio.h>
#include <xcb/xfixes.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <malloc.h>
#include "thunkgen_host_libxcb-xfixes.inl"
static void fexfn_impl_libxcb_xfixes_FEX_xcb_xfixes_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1);
static size_t fexfn_impl_libxcb_xfixes_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_xfixes_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_xfixes_FEX_xcb_xfixes_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "XFIXES") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_xfixes_so, "xcb_xfixes_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_xfixes)
@@ -1,265 +0,0 @@
#include <common/GeneratorInterface.h>
#include <xcb/xfixes.h>
#include <xcb/xcbext.h>
template<auto>
struct fex_gen_config {
unsigned version = 0;
};
template<typename>
struct fex_gen_type {};
template<>
struct fex_gen_type<xcb_connection_t> : fexgen::opaque_type {};
void FEX_xcb_xfixes_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_xfixes_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_xfixes_query_version> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_query_version_unchecked> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_query_version_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_change_save_set_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_change_save_set> {};
template<>
struct fex_gen_config<xcb_xfixes_select_selection_input_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_select_selection_input> {};
template<>
struct fex_gen_config<xcb_xfixes_select_cursor_input_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_select_cursor_input> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_unchecked> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_cursor_image> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_cursor_image_length> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_cursor_image_end> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_region_next> {};
template<>
struct fex_gen_config<xcb_xfixes_region_end> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_rectangles> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_rectangles_length> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_rectangles_iterator> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_bitmap_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_bitmap> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_window_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_window> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_gc_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_gc> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_picture_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_create_region_from_picture> {};
template<>
struct fex_gen_config<xcb_xfixes_destroy_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_destroy_region> {};
template<>
struct fex_gen_config<xcb_xfixes_set_region_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_set_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_set_region> {};
template<>
struct fex_gen_config<xcb_xfixes_set_region_rectangles> {};
template<>
struct fex_gen_config<xcb_xfixes_set_region_rectangles_length> {};
template<>
struct fex_gen_config<xcb_xfixes_set_region_rectangles_iterator> {};
template<>
struct fex_gen_config<xcb_xfixes_copy_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_copy_region> {};
template<>
struct fex_gen_config<xcb_xfixes_union_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_union_region> {};
template<>
struct fex_gen_config<xcb_xfixes_intersect_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_intersect_region> {};
template<>
struct fex_gen_config<xcb_xfixes_subtract_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_subtract_region> {};
template<>
struct fex_gen_config<xcb_xfixes_invert_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_invert_region> {};
template<>
struct fex_gen_config<xcb_xfixes_translate_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_translate_region> {};
template<>
struct fex_gen_config<xcb_xfixes_region_extents_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_region_extents> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region_unchecked> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region_rectangles> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region_rectangles_length> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region_rectangles_iterator> {};
template<>
struct fex_gen_config<xcb_xfixes_fetch_region_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_set_gc_clip_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_set_gc_clip_region> {};
template<>
struct fex_gen_config<xcb_xfixes_set_window_shape_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_set_window_shape_region> {};
template<>
struct fex_gen_config<xcb_xfixes_set_picture_clip_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_set_picture_clip_region> {};
template<>
struct fex_gen_config<xcb_xfixes_set_cursor_name_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_set_cursor_name_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_set_cursor_name> {};
template<>
struct fex_gen_config<xcb_xfixes_set_cursor_name_name> {};
template<>
struct fex_gen_config<xcb_xfixes_set_cursor_name_name_length> {};
template<>
struct fex_gen_config<xcb_xfixes_set_cursor_name_name_end> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name_unchecked> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name_name> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name_name_length> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name_name_end> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_name_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_unchecked> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_cursor_image> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_cursor_image_length> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_cursor_image_end> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_name> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_name_length> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_name_end> {};
template<>
struct fex_gen_config<xcb_xfixes_get_cursor_image_and_name_reply> : fexgen::custom_guest_entrypoint {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_by_name_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_by_name_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_by_name> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_by_name_name> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_by_name_name_length> {};
template<>
struct fex_gen_config<xcb_xfixes_change_cursor_by_name_name_end> {};
template<>
struct fex_gen_config<xcb_xfixes_expand_region_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_expand_region> {};
template<>
struct fex_gen_config<xcb_xfixes_hide_cursor_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_hide_cursor> {};
template<>
struct fex_gen_config<xcb_xfixes_show_cursor_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_show_cursor> {};
template<>
struct fex_gen_config<xcb_xfixes_barrier_next> {};
template<>
struct fex_gen_config<xcb_xfixes_barrier_end> {};
template<>
struct fex_gen_config<xcb_xfixes_create_pointer_barrier_sizeof> {};
template<>
struct fex_gen_config<xcb_xfixes_create_pointer_barrier_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_create_pointer_barrier> {};
template<>
struct fex_gen_config<xcb_xfixes_create_pointer_barrier_devices> {};
template<>
struct fex_gen_config<xcb_xfixes_create_pointer_barrier_devices_length> {};
template<>
struct fex_gen_config<xcb_xfixes_create_pointer_barrier_devices_end> {};
template<>
struct fex_gen_config<xcb_xfixes_delete_pointer_barrier_checked> {};
template<>
struct fex_gen_config<xcb_xfixes_delete_pointer_barrier> {};
File diff suppressed because it is too large. Load diff
-61
View File
@@ -1,61 +0,0 @@
/*
$info$
tags: thunklibs|xcb
$end_info$
*/
#include <chrono>
#include <cstring>
#include <malloc.h>
#include <thread>
#include <stdio.h>
#include <unistd.h>
#include <syscall.h>
#include <sys/syscall.h>
#include <xcb/xcb.h>
#include <xcb/xcbext.h>
#include "common/Host.h"
#include <dlfcn.h>
#include <unordered_map>
#include "thunkgen_host_libxcb.inl"
static void fexfn_impl_libxcb_FEX_xcb_init_extension(xcb_connection_t*, xcb_extension_t*);
static size_t fexfn_impl_libxcb_FEX_usable_size(void*);
static void fexfn_impl_libxcb_FEX_free_on_host(void*);
static size_t fexfn_impl_libxcb_FEX_usable_size(void* a_0) {
return malloc_usable_size(a_0);
}
static void fexfn_impl_libxcb_FEX_free_on_host(void* a_0) {
free(a_0);
}
static void fexfn_impl_libxcb_FEX_xcb_init_extension(xcb_connection_t* a_0, xcb_extension_t* a_1) {
xcb_extension_t* ext {};
if (strcmp(a_1->name, "BIG-REQUESTS") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_so, "xcb_big_requests_id");
} else if (strcmp(a_1->name, "XC-MISC") == 0) {
ext = (xcb_extension_t*)dlsym(fexldr_ptr_libxcb_so, "xcb_xc_misc_id");
} else {
fprintf(stderr, "Unknown xcb extension '%s'\n", a_1->name);
__builtin_trap();
return;
}
if (!ext) {
fprintf(stderr, "Couldn't find extension symbol: '%s'\n", a_1->name);
__builtin_trap();
return;
}
[[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)
File diff suppressed because it is too large. Load diff