-
Notifications
You must be signed in to change notification settings - Fork 94
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
Clean up rootless.h, add optional Xina compatibility #81
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice solution to implementing ROOT_PATH_VAR
in C.
This still has an issue in a situation such as
char *getName() {
char *name = malloc(64);
// ...
return ROOT_PATH_VAR(name);
}
however I do not believe it is possible to handle a case like this without leaking memory in C.
It occurs to me that VAR
variants of these macros should not be used at all (instead, only the literal parts of paths need to be adjusted), however I think that's a separate discussion.
Yeah I mean you can't really expect the VAR macros to free anything, you always need to free stuff yourself. While yeah I do agree these macros don't have a big use case, they should still exist for completion. |
Shit I forgot to address this the char arrays need to be changed to alloca because otherwise the compiler sometimes overwrites them. So |
I see. Per my previous comments though, I think the |
What does this implement/fix? Explain your changes.
This removes the code checking whether
THEOS_PACKAGE_INSTALL_PREFIX
is define, as this is now always defined.Additionally it introduces backwards support for xina with the define
XINA_SUPPORT
that a dev can set inside the Makefile if Xina support is desired. Note that this should only be set for rootful builds.