mirror of
https://github.com/gnustep/libs-base.git
synced 2025-05-31 16:50:58 +00:00
Update pathc check
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@6609 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
8395a055d8
commit
54d8f446f6
3 changed files with 21 additions and 11 deletions
|
@ -1,3 +1,10 @@
|
||||||
|
2000-05-23 Adam Fedor <fedor@gnu.org>
|
||||||
|
|
||||||
|
* Source/NSBundle.m (+initialize): Check if /proc/self/exe returns
|
||||||
|
a real link, otherwise get path from NSProcessInfo.
|
||||||
|
|
||||||
|
* NSData: Correct #ifdef NEEDS_WORD_ALIGN to #if
|
||||||
|
|
||||||
2000-05-22 Richard Frith-Macdonald <rfm@gnu.org>
|
2000-05-22 Richard Frith-Macdonald <rfm@gnu.org>
|
||||||
|
|
||||||
* Source/GSeq.h: comparison with zero length range is always
|
* Source/GSeq.h: comparison with zero length range is always
|
||||||
|
|
|
@ -279,17 +279,20 @@ _bundle_load_callback(Class theClass, Category *theCategory)
|
||||||
mutableCopy]);
|
mutableCopy]);
|
||||||
[system appendString: @"/Libraries"];
|
[system appendString: @"/Libraries"];
|
||||||
|
|
||||||
|
_executable_path = nil;
|
||||||
#ifdef HAVE_PROC_FS_EXE_LINK
|
#ifdef HAVE_PROC_FS_EXE_LINK
|
||||||
_executable_path = [[NSFileManager defaultManager]
|
_executable_path = [[NSFileManager defaultManager]
|
||||||
pathContentOfSymbolicLinkAtPath: @"/proc/self/exe"];
|
pathContentOfSymbolicLinkAtPath: @"/proc/self/exe"];
|
||||||
#else
|
|
||||||
_executable_path =
|
|
||||||
[[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
|
|
||||||
output = objc_find_executable([_executable_path cString]);
|
|
||||||
NSAssert(output, NSInternalInconsistencyException);
|
|
||||||
_executable_path = [NSString stringWithCString: output];
|
|
||||||
OBJC_FREE(output);
|
|
||||||
#endif
|
#endif
|
||||||
|
if (_executable_path == nil || [_executable_path length] == 0)
|
||||||
|
{
|
||||||
|
_executable_path =
|
||||||
|
[[[NSProcessInfo processInfo] arguments] objectAtIndex: 0];
|
||||||
|
output = objc_find_executable([_executable_path cString]);
|
||||||
|
NSAssert(output, NSInternalInconsistencyException);
|
||||||
|
_executable_path = [NSString stringWithCString: output];
|
||||||
|
OBJC_FREE(output);
|
||||||
|
}
|
||||||
|
|
||||||
RETAIN(_executable_path);
|
RETAIN(_executable_path);
|
||||||
_gnustep_bundle = RETAIN([NSBundle bundleWithPath: system]);
|
_gnustep_bundle = RETAIN([NSBundle bundleWithPath: system]);
|
||||||
|
|
|
@ -2073,7 +2073,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
||||||
format: @"Range: (%u, 1) Size: %d",
|
format: @"Range: (%u, 1) Size: %d",
|
||||||
*cursor, length];
|
*cursor, length];
|
||||||
}
|
}
|
||||||
#ifdef NEED_WORD_ALIGNMENT
|
#if NEED_WORD_ALIGNMENT
|
||||||
if ((*cursor % __alignof__(gsu16)) == 0)
|
if ((*cursor % __alignof__(gsu16)) == 0)
|
||||||
memcpy(&x, (bytes + *cursor), 2);
|
memcpy(&x, (bytes + *cursor), 2);
|
||||||
else
|
else
|
||||||
|
@ -2093,7 +2093,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
||||||
format: @"Range: (%u, 1) Size: %d",
|
format: @"Range: (%u, 1) Size: %d",
|
||||||
*cursor, length];
|
*cursor, length];
|
||||||
}
|
}
|
||||||
#ifdef NEED_WORD_ALIGNMENT
|
#if NEED_WORD_ALIGNMENT
|
||||||
if ((*cursor % __alignof__(gsu32)) == 0)
|
if ((*cursor % __alignof__(gsu32)) == 0)
|
||||||
memcpy(&x, (bytes + *cursor), 4);
|
memcpy(&x, (bytes + *cursor), 4);
|
||||||
else
|
else
|
||||||
|
@ -2986,7 +2986,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
||||||
[self _grow: length + 3];
|
[self _grow: length + 3];
|
||||||
}
|
}
|
||||||
*(gsu8*)(bytes + length++) = tag;
|
*(gsu8*)(bytes + length++) = tag;
|
||||||
#ifdef NEED_WORD_ALIGNMENT
|
#if NEED_WORD_ALIGNMENT
|
||||||
if ((length % __alignof__(gsu16)) == 0)
|
if ((length % __alignof__(gsu16)) == 0)
|
||||||
{
|
{
|
||||||
x = GSSwapHostI16ToBig(x);
|
x = GSSwapHostI16ToBig(x);
|
||||||
|
@ -3007,7 +3007,7 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
|
||||||
[self _grow: length + 5];
|
[self _grow: length + 5];
|
||||||
}
|
}
|
||||||
*(gsu8*)(bytes + length++) = tag;
|
*(gsu8*)(bytes + length++) = tag;
|
||||||
#ifdef NEED_WORD_ALIGNMENT
|
#if NEED_WORD_ALIGNMENT
|
||||||
if ((length % __alignof__(gsu32)) == 0)
|
if ((length % __alignof__(gsu32)) == 0)
|
||||||
{
|
{
|
||||||
x = GSSwapHostI32ToBig(x);
|
x = GSSwapHostI32ToBig(x);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue