Changes from Scott Christley. See ChangeLog Feb 27 13:46:10

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@2294 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
mccallum 1997-05-03 17:24:31 +00:00
parent e429bc2220
commit 47f8cb6098
7 changed files with 30 additions and 11 deletions

View file

@ -58,7 +58,7 @@ NSLocationInRange(unsigned location, NSRange range)
/* Create an NSRange having the specified LOCATION and LENGTH. */ /* Create an NSRange having the specified LOCATION and LENGTH. */
extern NSRange extern NSRange
NSMakeRange(float location, float length); NSMakeRange(unsigned int location, unsigned int length);
extern NSRange extern NSRange
NSUnionRange(NSRange range1, NSRange range2); NSUnionRange(NSRange range1, NSRange range2);

View file

@ -53,7 +53,7 @@ YACC = bison
# GNUSTEP_INSTALL_PREFIX must be defined here and not in config.h because # GNUSTEP_INSTALL_PREFIX must be defined here and not in config.h because
# the installing person may set it on the `make' command line. # the installing person may set it on the `make' command line.
DEFS= -DGNUSTEP_INSTALL_PREFIX=$(prefix) -DPLATFORM_OS=\"@PLATFORM_OS@\" \ DEFS= -DGNUSTEP_INSTALL_PREFIX=$(prefix) -DPLATFORM_OS=\"@PLATFORM_OS@\" \
-DGNUSTEP_INSTALL_LIBDIR=$(gnustep_libdir) @DEFS@ -DGNUSTEP_INSTALL_LIBDIR=\"$(gnustep_libdir)\" @DEFS@
# File name extensions # File name extensions
OEXT = .o OEXT = .o

View file

@ -112,6 +112,12 @@ static NSString* platform =
#else #else
nil; nil;
#endif #endif
static NSString* gnustep_libdir =
#ifdef GNUSTEP_INSTALL_LIBDIR
@GNUSTEP_INSTALL_LIBDIR;
#else
nil;
#endif
/* Declaration from find_exec.c */ /* Declaration from find_exec.c */
extern char *objc_find_executable(const char *name); extern char *objc_find_executable(const char *name);
@ -470,6 +476,8 @@ _bundle_load_callback(Class theClass, Category *theCategory)
<main bundle>/Resources/<bundlePath>/<language.lproj> <main bundle>/Resources/<bundlePath>/<language.lproj>
<main bundle>/<bundlePath> <main bundle>/<bundlePath>
<main bundle>/<bundlePath>/<language.lproj> <main bundle>/<bundlePath>/<language.lproj>
<gnustep library installation directory>/<bundlePath>
<gnustep library installation directory>/<bundlePath>/<language.lproj>
*/ */
- (NSArray *) _bundleResourcePathsWithDirectory: (NSString *)bundlePath - (NSArray *) _bundleResourcePathsWithDirectory: (NSString *)bundlePath
{ {
@ -479,7 +487,7 @@ _bundle_load_callback(Class theClass, Category *theCategory)
NSMutableArray* array; NSMutableArray* array;
NSEnumerator* enumerate; NSEnumerator* enumerate;
array = [NSMutableArray arrayWithCapacity: 2]; array = [NSMutableArray arrayWithCapacity: 8];
languages = [NSUserDefaults userLanguages]; languages = [NSUserDefaults userLanguages];
primary = [self resourcePath]; primary = [self resourcePath];
@ -493,6 +501,18 @@ _bundle_load_callback(Class theClass, Category *theCategory)
enumerate = [languages objectEnumerator]; enumerate = [languages objectEnumerator];
while ((language = [enumerate nextObject])) while ((language = [enumerate nextObject]))
[array addObject: _bundle_resource_path(primary, bundlePath, language)]; [array addObject: _bundle_resource_path(primary, bundlePath, language)];
if (gnustep_libdir)
{
primary = [NSString stringWithCString: [gnustep_libdir cString]];
[array addObject: _bundle_resource_path(primary, bundlePath, nil)];
enumerate = [languages objectEnumerator];
while ((language = [enumerate nextObject]))
[array addObject:
_bundle_resource_path(primary, bundlePath, language)];
}
return array; return array;
} }

View file

@ -27,9 +27,7 @@
#include <Foundation/NSData.h> #include <Foundation/NSData.h>
#include <Foundation/NSLock.h> #include <Foundation/NSLock.h>
#ifndef NSCharacterSet_PATH static NSString* NSCharacterSet_PATH = @"NSCharacterSets";
#define NSCharacterSet_PATH OBJC_STRINGIFY(GNUSTEP_INSTALL_LIBDIR) @"/NSCharacterSets"
#endif
/* A simple array for caching standard bitmap sets */ /* A simple array for caching standard bitmap sets */
#define MAX_STANDARD_SETS 12 #define MAX_STANDARD_SETS 12

View file

@ -5,7 +5,7 @@
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
NSRange NSRange
NSMakeRange(float location, float length) NSMakeRange(unsigned int location, unsigned int length)
{ {
NSRange range; NSRange range;
range.location = location; range.location = location;

View file

@ -1230,7 +1230,7 @@ handle_printf_atsign (FILE *stream,
NSString *newstring; NSString *newstring;
range = [self rangeOfString:@"/" options:NSBackwardsSearch]; range = [self rangeOfString:@"/" options:NSBackwardsSearch];
if (range.length != 0 && range.location != [self length] - 1) if (range.length == 0 && range.location != [self length] - 1)
newstring = [self stringByAppendingString:@"/"]; newstring = [self stringByAppendingString:@"/"];
else else
newstring = self; newstring = self;
@ -1247,8 +1247,8 @@ handle_printf_atsign (FILE *stream,
NSRange range; NSRange range;
NSString *newstring; NSString *newstring;
range = [aString rangeOfString:@"." options:NSBackwardsSearch]; range = [self rangeOfString:@"." options:NSBackwardsSearch];
if (range.length != 0 && range.location != [self length] - 1) if ((range.length == 0) && (range.location != ([self length] - 1)))
newstring = [self stringByAppendingString:@"."]; newstring = [self stringByAppendingString:@"."];
else else
newstring = self; newstring = self;

View file

@ -284,7 +284,8 @@ AC_CHECK_LIB(nsl, main)
#-------------------------------------------------------------------- #--------------------------------------------------------------------
# Make a shared library? # Make a shared library?
#-------------------------------------------------------------------- #--------------------------------------------------------------------
AC_ARG_ENABLE(shared, Build the library as a shared library, AC_ARG_ENABLE(shared,
[ --enable-shared Build the library as a shared library],
SHARED_LIBRARY='lib$(LIBRARY_NAME).so.$(VERSION)', SHARED_LIBRARY='lib$(LIBRARY_NAME).so.$(VERSION)',
SHARED_LIBRARY=) SHARED_LIBRARY=)
AC_SUBST(SHARED_LIBRARY) AC_SUBST(SHARED_LIBRARY)