mirror of
https://github.com/gnustep/libs-base.git
synced 2025-06-01 09:02:01 +00:00
Mangle/demangle framework names in NSFramework_xxx class names to support
'-' and '+' in framework names git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@21455 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
09688f94b6
commit
5abd5a81b4
2 changed files with 30 additions and 3 deletions
|
@ -1,3 +1,11 @@
|
||||||
|
2005-07-12 Nicola Pero <n.pero@mi.flashnet.it>
|
||||||
|
|
||||||
|
* Source/NSBundle.m ([+_addFrameworkFromClass:]),
|
||||||
|
([-executablePath]): Mangle/demangle framework names so that we
|
||||||
|
can support '-' (and '+') in framework names. Requires latest
|
||||||
|
gnustep-make if you have a framework with '_', '-' or '+' in the
|
||||||
|
name.
|
||||||
|
|
||||||
2005-07-08 Adam Fedor <fedor@gnu.org>
|
2005-07-08 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
* Testing/GNUmakefile, Testing/nsfilehandle.m: Minor fixes.
|
* Testing/GNUmakefile, Testing/nsfilehandle.m: Minor fixes.
|
||||||
|
|
|
@ -308,6 +308,14 @@ _find_framework(NSString *name)
|
||||||
/* The name of the framework. */
|
/* The name of the framework. */
|
||||||
NSString *name = [NSString stringWithCString: &frameworkClass->name[12]];
|
NSString *name = [NSString stringWithCString: &frameworkClass->name[12]];
|
||||||
|
|
||||||
|
/* Important - gnustep-make mangles framework names to encode
|
||||||
|
* them as ObjC class names. Here we need to demangle them. We
|
||||||
|
* apply the reverse transformations in the reverse order.
|
||||||
|
*/
|
||||||
|
name = [name stringByReplacingString: @"_1" withString: @"+"];
|
||||||
|
name = [name stringByReplacingString: @"_0" withString: @"-"];
|
||||||
|
name = [name stringByReplacingString: @"__" withString: @"_"];
|
||||||
|
|
||||||
/* Try getting the path to the framework using the dynamic
|
/* Try getting the path to the framework using the dynamic
|
||||||
* linker. When it works it's really cool :-) This is the only
|
* linker. When it works it's really cool :-) This is the only
|
||||||
* really universal way of getting the framework path ... we can
|
* really universal way of getting the framework path ... we can
|
||||||
|
@ -1561,11 +1569,22 @@ _bundle_load_callback(Class theClass, struct objc_category *theCategory)
|
||||||
}
|
}
|
||||||
if (_bundleType == NSBUNDLE_FRAMEWORK)
|
if (_bundleType == NSBUNDLE_FRAMEWORK)
|
||||||
{
|
{
|
||||||
|
/* Mangle the name before building the _currentFrameworkName,
|
||||||
|
* which really is a class name.
|
||||||
|
*/
|
||||||
|
NSString *mangledName = object;
|
||||||
|
mangledName = [mangledName stringByReplacingString: @"_"
|
||||||
|
withString: @"__"];
|
||||||
|
mangledName = [mangledName stringByReplacingString: @"-"
|
||||||
|
withString: @"_0"];
|
||||||
|
mangledName = [mangledName stringByReplacingString: @"+"
|
||||||
|
withString: @"_1"];
|
||||||
|
|
||||||
path = [_path stringByAppendingPathComponent:@"Versions/Current"];
|
path = [_path stringByAppendingPathComponent:@"Versions/Current"];
|
||||||
|
|
||||||
_currentFrameworkName = RETAIN(([NSString stringWithFormat:
|
_currentFrameworkName = RETAIN(([NSString stringWithFormat:
|
||||||
@"NSFramework_%@",
|
@"NSFramework_%@",
|
||||||
object]));
|
mangledName]));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue