Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrapped libraries refactor #1257

Merged
merged 6 commits into from
Feb 10, 2024
Merged

Wrapped libraries refactor #1257

merged 6 commits into from
Feb 10, 2024

Conversation

rajdakin
Copy link
Collaborator

This PR refactors various common operations on wrapped libraries initialization/finalization:

  • calling getMy(lib) in CUSTOM_INIT and freeMy() in CUSTOM_FINI, toggled by the HAS_MY macro;
  • calling SETALT in CUSTOM_INIT into the ALTMY macro;
  • calling setNeededLibs(lib, n, ...) in CUSTOM_INIT, called with the correct n using the NEEDED_LIBS macro.

#define PRE_INIT \
if(box64_nogtk) \
return -1;

#define CUSTOM_INIT \
libname = lib->name; \
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this line about libname disapeared?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, libname is unused in the entire file.

@@ -20,7 +20,7 @@
#include "gtkclass.h"

const char* gtkx112Name = "libgtk-x11-2.0.so.0";
static char* libname = NULL;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this was here because it use to be able to load gtk-1 also. I guess this is obsolete and can be remove completly, especially on 64bits?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. wrappedgdkx112.c still requires it, but wrappedgtkx112.c does not.

@ptitSeb ptitSeb merged commit b527ebb into ptitSeb:main Feb 10, 2024
30 checks passed
@rajdakin rajdakin deleted the wrapped_refactor branch February 10, 2024 14:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants