Skip to content

Commit

Permalink
[ANDROID] Add a few ALTNAMEs and unwrap ifdefs for lib names (#2224)
Browse files Browse the repository at this point in the history
* [WRAPPED][ANDROID] A few more ALTNAMEs

* [WRAPPED][ANDROID] Unwrap ifdefs for lib names
  • Loading branch information
olegos2 authored Dec 28, 2024
1 parent bb0a445 commit 6e1e7de
Show file tree
Hide file tree
Showing 25 changed files with 23 additions and 101 deletions.
7 changes: 2 additions & 5 deletions src/wrapped/wrappedcurl.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
#include "callback.h"
#include "elfloader.h"

#ifdef ANDROID
const char* curlName = "libcurl.so";
#else
const char* curlName = "libcurl.so.4";
#endif
const char* curlName = "libcurl.so.4";
#define ALTNAME "libcurl.so"

#define ALTNAME "libcurl-gnutls.so.4"
#define LIBNAME curl
Expand Down
7 changes: 2 additions & 5 deletions src/wrapped/wrappeddbusmenuglib.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,8 @@
#include "emu/x64emu_private.h"
#include "callback.h"

#ifdef ANDROID
const char* dbusmenuglibName = "libdbusmenu-glib.so";
#else
const char* dbusmenuglibName = "libdbusmenu-glib.so.4";
#endif
const char* dbusmenuglibName = "libdbusmenu-glib.so.4";
#define ALTNAME "libdbusmenu-glib.so"

#define LIBNAME dbusmenuglib

Expand Down
7 changes: 2 additions & 5 deletions src/wrapped/wrappedglesv2.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,8 @@
#include "librarian/library_private.h"
#include "x64emu.h"

#ifdef ANDROID
const char* glesv2Name = "libGLESv2.so";
#else
const char* glesv2Name = "libGLESv2.so.2";
#endif
const char* glesv2Name = "libGLESv2.so.2";
#define ALTNAME "libGLESv2.so"

#define LIBNAME glesv2

Expand Down
1 change: 1 addition & 0 deletions src/wrapped/wrappedgmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "callback.h"

const char* gmpName = "libgmp.so.10";
#define ALTNAME "libgmp.so"
#define LIBNAME gmp

#include "generated/wrappedgmptypes.h"
Expand Down
1 change: 1 addition & 0 deletions src/wrapped/wrappedidn2.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "x64emu.h"

const char* idn2Name = "libidn2.so.0";
#define ALTNAME "libidn2.so"
#define LIBNAME idn2

#include "wrappedlib_init.h"
Expand Down
7 changes: 2 additions & 5 deletions src/wrapped/wrappedkrb5.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,8 @@
#include "librarian.h"
#include "callback.h"

#ifdef ANDROID
const char* krb5Name = "libkrb5.so";
#else
const char* krb5Name = "libkrb5.so.3";
#endif
const char* krb5Name = "libkrb5.so.3";
#define ALTNAME "libkrb5.so"

#define LIBNAME krb5

Expand Down
4 changes: 0 additions & 4 deletions src/wrapped/wrappedldapr.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,6 @@ EXPORT int my_ldap_sasl_interactive_bind_s(x64emu_t* emu, void* ld, void* dn, vo
return my->ldap_sasl_interactive_bind_s(ld, dn, mechs, sctrls, cctrls, flags, find_LDAP_SASL_INTERACT_PROC_Fct(f), defaults);
}

#ifdef ANDROID
#define NEEDED_LIBS "liblber-2.4.so"
#else
#define NEEDED_LIBS "liblber-2.4.so.2"
#endif

#include "wrappedlib_init.h"
1 change: 1 addition & 0 deletions src/wrapped/wrappedlibdrm.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "myalign.h"

const char* libdrmName = "libdrm.so.2";
#define ALTNAME "libdrm.so"
#define LIBNAME libdrm

#define ADDED_FUNCTIONS() \
Expand Down
1 change: 1 addition & 0 deletions src/wrapped/wrappedlibnettle8.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#include "myalign.h"

const char* libnettle8Name = "libnettle.so.8";
#define ALTNAME "libnettle.so"
#define LIBNAME libnettle8

#define ADDED_FUNCTIONS()
Expand Down
1 change: 1 addition & 0 deletions src/wrapped/wrappedlibunistring2.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "x64emu.h"

const char* libunistring2Name = "libunistring.so.2";
#define ALTNAME "libunistring.so"
#define LIBNAME libunistring2

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibx11.c
Original file line number Diff line number Diff line change
Expand Up @@ -1621,10 +1621,6 @@ EXPORT void* my__XGetRequest(x64emu_t* emu, my_XDisplay_t* dpy, uint8_t type, si
AddAutomaticBridge(lib->w.bridge, vFp, *(void**)dlsym(lib->w.lib, "_XUnlockMutex_fn"), 0, "_XUnlockMutex_fn"); \
if(box64_x11threads) my->XInitThreads();

#ifdef ANDROID
#define NEEDED_LIBS "libxcb.so"
#else
#define NEEDED_LIBS "libxcb.so.1"
#endif

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxcb.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,10 +49,6 @@ EXPORT void my_xcb_disconnect(x64emu_t* emu, void* conn)
del_xcb_connection(conn);
}

#ifdef ANDROID
#define NEEDED_LIBS "libXau.so", "libXdmcp.so"
#else
#define NEEDED_LIBS "libXau.so.6", "libXdmcp.so.6"
#endif

#include "wrappedlib_init.h"
7 changes: 2 additions & 5 deletions src/wrapped/wrappedlibxcbcursor.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
#include "box64context.h"
#include "emu/x64emu_private.h"

#ifdef ANDROID
const char* libxcbcursorName = "libxcb-cursor.so";
#else
const char* libxcbcursorName = "libxcb-cursor.so.0";
#endif
const char* libxcbcursorName = "libxcb-cursor.so.0";
#define ALTNAME "libxcb-cursor.so"

#define LIBNAME libxcbcursor

Expand Down
7 changes: 2 additions & 5 deletions src/wrapped/wrappedlibxcbres.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
#include "box64context.h"
#include "emu/x64emu_private.h"

#ifdef ANDROID
const char* libxcbresName = "libxcb-res.so";
#else
const char* libxcbresName = "libxcb-res.so.0";
#endif
const char* libxcbresName = "libxcb-res.so.0";
#define ALTNAME "libxcb-res.so"

#define LIBNAME libxcbres

Expand Down
7 changes: 2 additions & 5 deletions src/wrapped/wrappedlibxcbxinput.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
#include "box64context.h"
#include "emu/x64emu_private.h"

#ifdef ANDROID
const char* libxcbxinputName = "libxcb-xinput.so";
#else
const char* libxcbxinputName = "libxcb-xinput.so.0";
#endif
const char* libxcbxinputName = "libxcb-xinput.so.0";
#define ALTNAME "libxcb-xinput.so"
#define LIBNAME libxcbxinput

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxext.c
Original file line number Diff line number Diff line change
Expand Up @@ -387,10 +387,6 @@ EXPORT void* my_XextAddDisplay(x64emu_t* emu, void* extinfo, void* dpy, void* ex
return ret;
}

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libxcb.so", "libXau.so", "libdl.so", "libXdmcp.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libxcb.so.1", "libXau.so.6", "libdl.so.2", "libXdmcp.so.6"
#endif

#include "wrappedlib_init.h"
7 changes: 0 additions & 7 deletions src/wrapped/wrappedlibxft.c
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,6 @@ EXPORT void* my_XftFontOpen(x64emu_t* emu, void* dpy, int screen, uintptr_t* b)
return ret;
}


#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libfontconfig.so", "libXrender.so", "libfreetype.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libfontconfig.so.1", "libXrender.so.1", "libfreetype.so.6"
#endif



#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxi.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const char* libxiName = "libXi.so.6";

#define LIBNAME libxi

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libXext.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libXext.so.6"
#endif

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxrandr.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ const char* libxrandrName = "libXrandr.so.2";

#define LIBNAME libxrandr

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libXext.so", "libXrender.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libXext.so.6", "libXrender.so.1"
#endif

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxt.c
Original file line number Diff line number Diff line change
Expand Up @@ -216,10 +216,6 @@ EXPORT void my_XtAddRawEventHandler(x64emu_t* emu, void* w, uint32_t mask, int n
my->XtAddRawEventHandler(w, mask, nonmaskable, findXtEventHandlerFct(f), data);
}

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libXext.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libXext.so.6"
#endif

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxtst.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,6 @@ EXPORT int my_XRecordEnableContext(x64emu_t* emu, void* display, void* context,
return my->XRecordEnableContext(display, context, find_XRecordInterceptProc_Fct(cb), closure);
}

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libXext.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libXext.so.6"
#endif

#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedlibxxf86vm.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,6 @@ const char* libxxf86vmName = "libXxf86vm.so.1";

#define LIBNAME libxxf86vm

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libXext.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libXext.so.6"
#endif

#include "wrappedlib_init.h"
11 changes: 2 additions & 9 deletions src/wrapped/wrappedpango.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
#include "box64context.h"
#include "emu/x64emu_private.h"

#ifdef ANDROID
const char* pangoName = "libpango-1.0.so";
#else
const char* pangoName = "libpango-1.0.so.0";
#endif
const char* pangoName = "libpango-1.0.so.0";
#define ALTNAME "libpango-1.0.so"
#define LIBNAME pango

#include "generated/wrappedpangotypes.h"
Expand Down Expand Up @@ -100,10 +97,6 @@ EXPORT void my_pango_attribute_init(x64emu_t* emu, void* attr, my_PangoAttrClass
if(box64_nogtk) \
return -1;

#ifdef ANDROID
#define NEEDED_LIBS "libgobject-2.0.so", "libglib-2.0.so"
#else
#define NEEDED_LIBS "libgobject-2.0.so.0", "libglib-2.0.so.0"
#endif

#include "wrappedlib_init.h"
12 changes: 2 additions & 10 deletions src/wrapped/wrappedpulsemainloopglib.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,8 @@
#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
const char* pulsemainloopglibName = "libpulse-mainloop-glib.so.0";
#define ALTNAME "libpulse-mainloop-glib.so"

#define LIBNAME pulsemainloopglib

Expand All @@ -41,11 +38,6 @@ EXPORT void* my_pa_glib_mainloop_get_api(x64emu_t* emu, void* mainloop)
if(box64_nopulse) \
return -1;

#ifdef ANDROID
#define NEEDED_LIBS "libpulse.so"
#else
#define NEEDED_LIBS "libpulse.so.0"
#endif


#include "wrappedlib_init.h"
4 changes: 0 additions & 4 deletions src/wrapped/wrappedxinerama.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,6 @@ const char* xineramaName = "libXinerama.so.1";

#define LIBNAME xinerama

#ifdef ANDROID
#define NEEDED_LIBS "libX11.so", "libXext.so"
#else
#define NEEDED_LIBS "libX11.so.6", "libXext.so.6"
#endif

#include "wrappedlib_init.h"

0 comments on commit 6e1e7de

Please sign in to comment.