about summary refs log tree commit diff stats
path: root/src
diff options
context:
space:
mode:
authorptitSeb <sebastien.chev@gmail.com>2024-01-16 18:22:52 +0100
committerptitSeb <sebastien.chev@gmail.com>2024-01-16 18:22:52 +0100
commit92f7b6fd9e3333f09381bfbf639e97a2d108a1e0 (patch)
treeb6f71525812b766bfe339a0ff6d034c7a6c2c018 /src
parent68c7586c4c2c80903af142d6e219562612d5cc7a (diff)
downloadbox64-92f7b6fd9e3333f09381bfbf639e97a2d108a1e0.tar.gz
box64-92f7b6fd9e3333f09381bfbf639e97a2d108a1e0.zip
Wrapped libpulse-mainloop-glib (for #1203, untested)
Diffstat (limited to 'src')
-rw-r--r--src/library_list.h1
-rw-r--r--src/wrapped/generated/functions_list.txt3
-rw-r--r--src/wrapped/generated/wrappedpulsemainloopglibdefs.h8
-rw-r--r--src/wrapped/generated/wrappedpulsemainloopglibtypes.h19
-rw-r--r--src/wrapped/generated/wrappedpulsemainloopglibundefs.h8
-rw-r--r--src/wrapped/wrappedpulse.c5
-rw-r--r--src/wrapped/wrappedpulsemainloopglib.c54
-rw-r--r--src/wrapped/wrappedpulsemainloopglib_private.h7
8 files changed, 105 insertions, 0 deletions
diff --git a/src/library_list.h b/src/library_list.h
index 21f3a377..28609f57 100644
--- a/src/library_list.h
+++ b/src/library_list.h
@@ -117,6 +117,7 @@ GO("libuuid.so.1", libuuid)
 GO("libresolv.so.2", libresolv)
 GO("libresolv.so", libresolv)
 GO("libpulse-simple.so.0", pulsesimple)
+GO("libpulse-mainloop-glib.so.0", pulsemainloopglib)
 GO("libpulse.so.0", pulse)
 GO("libsndfile.so.1", libsndfile)
 GO("libgtk-x11-2.0.so.0", gtkx112)
diff --git a/src/wrapped/generated/functions_list.txt b/src/wrapped/generated/functions_list.txt
index cd823750..74501de4 100644
--- a/src/wrapped/generated/functions_list.txt
+++ b/src/wrapped/generated/functions_list.txt
@@ -5091,6 +5091,9 @@ wrappedpulse:
   - pa_stream_write
 - pFpiuCppp:
   - pa_ext_device_restore_save_formats
+wrappedpulsemainloopglib:
+- pFp:
+  - pa_glib_mainloop_get_api
 wrappedpulsesimple:
 wrappedsdl1:
 - vFp:
diff --git a/src/wrapped/generated/wrappedpulsemainloopglibdefs.h b/src/wrapped/generated/wrappedpulsemainloopglibdefs.h
new file mode 100644
index 00000000..8492f36a
--- /dev/null
+++ b/src/wrapped/generated/wrappedpulsemainloopglibdefs.h
@@ -0,0 +1,8 @@
+/*******************************************************************
+ * File automatically generated by rebuild_wrappers.py (v2.4.0.20) *
+ *******************************************************************/
+#ifndef __wrappedpulsemainloopglibDEFS_H_
+#define __wrappedpulsemainloopglibDEFS_H_
+
+
+#endif // __wrappedpulsemainloopglibDEFS_H_
diff --git a/src/wrapped/generated/wrappedpulsemainloopglibtypes.h b/src/wrapped/generated/wrappedpulsemainloopglibtypes.h
new file mode 100644
index 00000000..0127cd2d
--- /dev/null
+++ b/src/wrapped/generated/wrappedpulsemainloopglibtypes.h
@@ -0,0 +1,19 @@
+/*******************************************************************
+ * File automatically generated by rebuild_wrappers.py (v2.4.0.20) *
+ *******************************************************************/
+#ifndef __wrappedpulsemainloopglibTYPES_H_
+#define __wrappedpulsemainloopglibTYPES_H_
+
+#ifndef LIBNAME
+#error You should only #include this file inside a wrapped*.c file
+#endif
+#ifndef ADDED_FUNCTIONS
+#define ADDED_FUNCTIONS() 
+#endif
+
+typedef void* (*pFp_t)(void*);
+
+#define SUPER() ADDED_FUNCTIONS() \
+	GO(pa_glib_mainloop_get_api, pFp_t)
+
+#endif // __wrappedpulsemainloopglibTYPES_H_
diff --git a/src/wrapped/generated/wrappedpulsemainloopglibundefs.h b/src/wrapped/generated/wrappedpulsemainloopglibundefs.h
new file mode 100644
index 00000000..c2475967
--- /dev/null
+++ b/src/wrapped/generated/wrappedpulsemainloopglibundefs.h
@@ -0,0 +1,8 @@
+/*******************************************************************
+ * File automatically generated by rebuild_wrappers.py (v2.4.0.20) *
+ *******************************************************************/
+#ifndef __wrappedpulsemainloopglibUNDEFS_H_
+#define __wrappedpulsemainloopglibUNDEFS_H_
+
+
+#endif // __wrappedpulsemainloopglibUNDEFS_H_
diff --git a/src/wrapped/wrappedpulse.c b/src/wrapped/wrappedpulse.c
index 7d782f29..8e808d55 100644
--- a/src/wrapped/wrappedpulse.c
+++ b/src/wrapped/wrappedpulse.c
@@ -1575,6 +1575,11 @@ EXPORT void my_pa_mainloop_api_once(x64emu_t* emu, void* mainloop, void* cb, voi
     my->pa_mainloop_api_once(mainloop, find_mainloop_once_Fct(cb), data);
 }
 
+void my_autobridge_mainloop_api(x64emu_t* emu, void* api)
+{
+    UpdateautobridgeMainloopAPI(emu, my_lib->w.bridge, api);
+}
+
 #define PRE_INIT        \
     if(box64_nopulse)   \
         return -1;
diff --git a/src/wrapped/wrappedpulsemainloopglib.c b/src/wrapped/wrappedpulsemainloopglib.c
new file mode 100644
index 00000000..b8ef0d50
--- /dev/null
+++ b/src/wrapped/wrappedpulsemainloopglib.c
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define _GNU_SOURCE         /* See feature_test_macros(7) */
+#include <dlfcn.h>
+
+#include "wrappedlibs.h"
+
+#include "debug.h"
+#include "wrapper.h"
+#include "bridge.h"
+#include "librarian/library_private.h"
+#include "x64emu.h"
+#include "emu/x64emu_private.h"
+#include "callback.h"
+#include "box64context.h"
+#include "librarian.h"
+#include "myalign.h"
+
+#ifdef ANDROID
+    const char* pulsemainloopglibName = "libpulse-mainloop-glib.so";
+#else
+    const char* pulsemainloopglibName = "libpulse-mainloop-glib.so.0";
+#endif
+
+#define LIBNAME pulsemainloopglib
+
+#include "generated/wrappedpulsemainloopglibtypes.h"
+
+#include "wrappercallback.h"
+
+void my_autobridge_mainloop_api(x64emu_t* emu, void* api);  // defined in pulse.c
+EXPORT void* my_pa_glib_mainloop_get_api(x64emu_t* emu, void* mainloop)
+{
+    void* ret = my->pa_glib_mainloop_get_api(mainloop);
+    my_autobridge_mainloop_api(emu, ret);
+    return ret;
+}
+
+#define PRE_INIT        \
+    if(box64_nopulse)   \
+        return -1;
+
+#ifdef ANDROID
+    #define CUSTOM_INIT \
+        setNeededLibs(lib, 1, "libpulse.so");
+#else
+    #define CUSTOM_INIT \
+        setNeededLibs(lib, 1, "libpulse.so.0");
+#endif
+
+
+#include "wrappedlib_init.h"
+
diff --git a/src/wrapped/wrappedpulsemainloopglib_private.h b/src/wrapped/wrappedpulsemainloopglib_private.h
new file mode 100644
index 00000000..34d5d09d
--- /dev/null
+++ b/src/wrapped/wrappedpulsemainloopglib_private.h
@@ -0,0 +1,7 @@
+#if !(defined(GO) && defined(GOM) && defined(GO2) && defined(DATA))
+#error Meh...
+#endif
+
+GO(pa_glib_mainloop_free, vFp)
+GOM(pa_glib_mainloop_get_api, pFEp)
+GO(pa_glib_mainloop_new, pFp)