Merged 1.0 branch into main.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/base/trunk@9548 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Adam Fedor 2001-04-10 03:27:01 +00:00
parent d2dd19d498
commit ab320f7bb0
42 changed files with 1313 additions and 514 deletions

View file

@ -1,7 +1,7 @@
Announcement Announcement
************ ************
The GNUstep Base Library, version 0.9.2, is now available. The GNUstep Base Library, version 1.0.0, is now available.
What is the GNUstep Base Library? What is the GNUstep Base Library?
================================= =================================
@ -22,21 +22,9 @@ portion of the OpenStep standard (the Foundation library).
Where can you get it? How can you compile it? Where can you get it? How can you compile it?
============================================== ==============================================
The gstepbase-0.9.2.tar.gz distribution file has been placed on The gstepbase-1.0.0.tar.gz distribution file has been placed on
`ftp.gnustep.org' in `pub/gnustep/core'. `ftp.gnustep.org' in `pub/gnustep/core'.
The library requires gcc 2.8.0 or higher. Significant sections of The library requires gcc 2.8.0 or higher. See the `GNUstep-HOWTO'
the library do not work with the NeXT runtime, so we recommend using file for more instructions about compiling and installing the library.
gcc instead of NeXT's cc. See the `GNUstep-HOWTO' file for more
instructions about compiling and installing the library.
The `.tar' file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites.
For info about FTP via email, send email to `ftpmail@decwrl.dec.com'
with no subject line, and two-line body with line one `help' and line
two `quit'.
The most recent (not necessarily tested) snapshots of the library
will be placed on `alpha.gnu.org'.

105
ChangeLog
View file

@ -1,3 +1,7 @@
2001-04-09 Adam Fedor <fedor@gnu.org>
* 1.0 branch merged into main.
2001-04-06 Nicola Pero <n.pero@mi.flashnet.it> 2001-04-06 Nicola Pero <n.pero@mi.flashnet.it>
* Source/NSString.m (pathSepMember): Made trivial and inlined. * Source/NSString.m (pathSepMember): Made trivial and inlined.
@ -41,6 +45,107 @@
config/objc-sys-dynamic.m4, config/procfs-exe-link.m4: Autoconf config/objc-sys-dynamic.m4, config/procfs-exe-link.m4: Autoconf
macros used by configure.in. macros used by configure.in.
2001-04-08 Adam Fedor <fedor@gnu.org>
* Version: 1.0.0
* NEWS: Regenerated.
* Source/NSLock.m (-tryLock): Return NO if our thread has
already has the lock (like OpenStep).
(-lockBeforeDate:): block until date if our thread already has
the lock (like OpenStep).
* Source/NSData.m ([NSMutableDataMalloc
-replaceBytesInRange:withBytes:]): Check capacity, not length.
2001-04-04 Adam Fedor <fedor@gnu.org>
* config.guess: Update to latest version
* config.sub: Likewise.
2001-04-01 2001 Nicola Pero <n.pero@mi.flashnet.it>
* Source/GSValue.m ([-description]): Bug fix - was crashing upon
using %@ instead of %s for a char *.
2001-03-31 Adam Fedor <fedor@gnu.org>
* Documentation/announce.texi: Update.
* Documentation/install.texi: Likewise.
* Testing/Makefile.preamble: Set BUNDLE_LIBS on mingw and cygwin.
* Testing/nsbundle.m: add NSProcessInfo's initializeWithArguments:...
2001-03-28 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSProcessInfo.m: ([+load]) Fix in parsing of command line
arguments from /proc filesystem. On newer kernels the command line
arguments are terminated by a nul, on older systems they are separated
by a nul. The old code would add an extra (empty) argument to all
processes on newer kernels. The new code will lose a trailing empty
argument on older kernels :-( I view it as the lesser of two evils
since the extra empty arg confuses/breaks a lot of tools.
2001-03-27 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: Fix file copying for MINGW by using
windows native copy function - fix by Michael Scheibler.
Also tidied to conform to coding standards, and fixed to use
O_BINARY where the system defines it.
2001-03-26 Richard Frith-Macdonald <rfm@gnu.org>
* Headers/Foundation/NSObject.h: GS_EXPORT updates for MINGW
* Headers/Foundation/NSObCRuntime.h: ditto
* Headers/Foundation/NSRange.h: ditto
* Source/NSRange.m: ditto
Fixes suggested by Michael Scheibler
2001-03-24 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSData.m: ([-replaceBytesInRange:withBytes:]) bugfix ...
revert to check using '>' rather than '>=' to conform to documentation
and to be consistent with use of ranges in general.
* Documentation/gsdoc/NSMutableData.gsdoc: documented primitive methods.
* Documentation/gsdoc/NSFunctions.gsdoc: Some documentation for NSRange
added.
2001-03-23 Adam Fedor <fedor@gnu.org>
* Source/NSData.m: ([-replaceBytesInRange:withBytes:]) Check location
>= size.
2001-03-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSData.m: ([-replaceBytesInRange:withBytes:]) bugfix ...
extend data if range has location in data, but extent beyond data.
2001-03-23 Adam Fedor <fedor@gnu.org>
* Source/NSSerializer.m (serializeToInfo): Use memcpy to serialize
strings on machines that need word alignment.
* Source/NSTimeZone.m (decode): For decoding, likewise.
* Testing/thread-except.m: Use autorelease pools.
2001-03-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSFileManager.m: MINGW fixes by Michael Scheibler.
([_attributesAtPath:traverseLink:forCopy:]) fix 'cos windows lacks
symbolic links. ([-changeFileAttributes:atPath:]) workaround for
windows directories not having modification times.
([-fileSystemAttributesAtPath:]) fix for large volumes (matching
change for unix too ... use unsigned long long).
2001-03-23 Richard Frith-Macdonald <rfm@gnu.org>
* Source/NSObject.m: ([-methodSignatureForSelector:]) try to get a
valid method signature any way we can ... check for a valid method
first, use selector types next. Avoid crash when given nul selector
as an argument.
* Source/NSMethodSignature.m: ([+signatureWithObjCTypes:]) don't
crash when given nul pointer as argument.
2001-03-19 Jonathan Gapen <jagapen@home.com> 2001-03-19 Jonathan Gapen <jagapen@home.com>
* Source/NSString.m: Implement ([-localizedStringWithFormat:]). * Source/NSString.m: Implement ([-localizedStringWithFormat:]).

View file

@ -32,7 +32,7 @@ include ../Version
include ../config.mak include ../config.mak
# The documents to be generated # The documents to be generated
DOCUMENT_NAME = coding-standards DOCUMENT_NAME = coding-standards gnustep-base
# The text documents to be generated # The text documents to be generated
DOCUMENT_TEXT_NAME = \ DOCUMENT_TEXT_NAME = \

View file

@ -40,17 +40,5 @@ been placed on @samp{@value{GNUSTEP-BASE-SNAP-FTP-MACHINE}} in
@end ifclear @end ifclear
The library requires gcc @value{GCC-VERSION} or higher. The library requires gcc @value{GCC-VERSION} or higher.
Significant sections of the library do not work with the NeXT runtime, See the @samp{GNUstep-HOWTO}
so we recommend using gcc instead of NeXT's cc. See the @samp{GNUstep-HOWTO}
file for more instructions about compiling and installing the library. file for more instructions about compiling and installing the library.
The @samp{.tar} file is compressed with GNU gzip. Gzip can be obtained by
anonymous ftp at any of the GNU archive sites.
For info about FTP via email, send email to
@samp{ftpmail@@decwrl.dec.com} with no subject line, and two-line body
with line one @samp{help} and line two @samp{quit}.
The most recent (not necessarily tested) snapshots of the library will
be placed on @samp{@value{GNUSTEP-BASE-SNAP-FTP-MACHINE}}.

View file

@ -93,15 +93,10 @@ and the MacOS-X Foundation implementation.
@menu @menu
* Overview:: * Overview::
* Configuration::
* Classes::
* Tools::
* Installation::
* Implementation:: * Implementation::
* Concept Index::
@end menu @end menu
@node Overview, Configuration, Top, Top @node Overview, Implementation, Top, Top
@chapter Overview @chapter Overview
*The GNUstep Base Library (gstep-base) requires the GNUstep Makefile *The GNUstep Base Library (gstep-base) requires the GNUstep Makefile
@ -114,15 +109,13 @@ site @url{http://www.gnustep.org/information}.
Documentation for individual classes is included in gsdoc (and html) format Documentation for individual classes is included in gsdoc (and html) format
in the gsdoc directory. in the gsdoc directory.
@node Implementation, Concept Index, Installation, Top @node Implementation, , Overview, Top
@chapter Implementation Details @chapter Implementation Details
@menu @menu
* Memory Management:: * Memory Management::
* Memory Allocation:: * Memory Allocation::
* Reference Counting:: * Reference Counting::
* Garbage Collection::
* Time Zone::
@end menu @end menu
@node Memory Management, Memory Allocation, Implementation, Implementation @node Memory Management, Memory Allocation, Implementation, Implementation
@ -176,7 +169,7 @@ make memory management easy. In addition to this, the GNU Objective-C compiler
and the GNUstep system provide a memory sweeping garbage collection mechanism and the GNUstep system provide a memory sweeping garbage collection mechanism
(using the Boehm conservative garbage collection library). (using the Boehm conservative garbage collection library).
@node Reference Counting, Garbage Collection, Memory Allocation, Implementation @node Reference Counting, , Memory Allocation, Implementation
@section Reference Counting @section Reference Counting
The reference counting scheme for object allocation/deallocation is quite The reference counting scheme for object allocation/deallocation is quite

View file

@ -179,7 +179,7 @@
</list> </list>
</section> </section>
<section> <section>
<heading>The OpenStep functions</heading> <heading>The OpenStep functions and types</heading>
<list> <list>
<item><uref url="NSFunctions.html">Functions</uref></item> <item><uref url="NSFunctions.html">Functions</uref></item>
</list> </list>

View file

@ -174,7 +174,7 @@
<li><a href ="NSUserDefaults.html">NSUserDefaults</a> <li><a href ="NSUserDefaults.html">NSUserDefaults</a>
<li><a href ="NSValue.html">NSValue</a> <li><a href ="NSValue.html">NSValue</a>
</ul> </ul>
<h3><a name ="cont-6">The OpenStep functions</a></h3> <h3><a name ="cont-6">The OpenStep functions and types</a></h3>
<ul> <ul>
<li><a href ="NSFunctions.html">Functions</a> <li><a href ="NSFunctions.html">Functions</a>
</ul> </ul>

View file

@ -15,7 +15,7 @@
<p>Date: $Date$</p> <p>Date: $Date$</p>
<h2><a name ="cont-0">NSCalendarDate</a></h2> <h2><a name ="cont-0">NSCalendarDate</a></h2>
<h2><a name ="NSCalendarDate">NSCalendarDate</a></h2> <h2><a name ="NSCalendarDate">NSCalendarDate</a></h2>
<p><b>Declared in: </b> Foundation/NSDate.h</p> <p><b>Declared in: </b> Foundation/NSCalendarDate.h</p>
<p><b>Inherits from: </b> NSDate</p> <p><b>Inherits from: </b> NSDate</p>
<p><b>Conforms to: </b> NSCoding <p><b>Conforms to: </b> NSCoding
</p> </p>

View file

@ -56,6 +56,12 @@
<h3><a name ="method-1">characterSetWithBitmapRepresentation:</a></h3> <h3><a name ="method-1">characterSetWithBitmapRepresentation:</a></h3>
+ (NSCharacterSet*) <b>characterSetWithBitmapRepresentation:</b> (NSData*)data;<br> + (NSCharacterSet*) <b>characterSetWithBitmapRepresentation:</b> (NSData*)data;<br>
<p>
Returns a character set containing characters as encoded in the
<em>data</em> object.
</p>
<hr> <hr>
<h3><a name ="method-2">characterSetWithCharactersInString:</a></h3> <h3><a name ="method-2">characterSetWithCharactersInString:</a></h3>
@ -81,16 +87,34 @@
<h3><a name ="method-6">decimalDigitCharacterSet</a></h3> <h3><a name ="method-6">decimalDigitCharacterSet</a></h3>
+ (NSCharacterSet*) <b>decimalDigitCharacterSet</b>;<br> + (NSCharacterSet*) <b>decimalDigitCharacterSet</b>;<br>
<p>
Returns a character set containing characters that represent
the decimal digits 0 through 9.
</p>
<hr> <hr>
<h3><a name ="method-7">decomposableCharacterSet</a></h3> <h3><a name ="method-7">decomposableCharacterSet</a></h3>
+ (NSCharacterSet*) <b>decomposableCharacterSet</b>;<br> + (NSCharacterSet*) <b>decomposableCharacterSet</b>;<br>
<p>
Returns a character set containing individual charactars that
can be represented also by a composed character sequence.
</p>
<hr> <hr>
<h3><a name ="method-8">illegalCharacterSet</a></h3> <h3><a name ="method-8">illegalCharacterSet</a></h3>
+ (NSCharacterSet*) <b>illegalCharacterSet</b>;<br> + (NSCharacterSet*) <b>illegalCharacterSet</b>;<br>
<p>
Returns a character set containing unassigned (illegal)
character values.
</p>
<hr> <hr>
<h3><a name ="method-9">letterCharacterSet</a></h3> <h3><a name ="method-9">letterCharacterSet</a></h3>
@ -101,6 +125,13 @@
<h3><a name ="method-10">lowercaseLetterCharacterSet</a></h3> <h3><a name ="method-10">lowercaseLetterCharacterSet</a></h3>
+ (NSCharacterSet*) <b>lowercaseLetterCharacterSet</b>;<br> + (NSCharacterSet*) <b>lowercaseLetterCharacterSet</b>;<br>
<p>
Returns a character set that contains the lowercase characters.
This set does not include caseless characters, only those that
have corresponding characters in uppercase and/or titlecase.
</p>
<hr> <hr>
<h3><a name ="method-11">nonBaseCharacterSet</a></h3> <h3><a name ="method-11">nonBaseCharacterSet</a></h3>
@ -116,32 +147,68 @@
<h3><a name ="method-13">uppercaseLetterCharacterSet</a></h3> <h3><a name ="method-13">uppercaseLetterCharacterSet</a></h3>
+ (NSCharacterSet*) <b>uppercaseLetterCharacterSet</b>;<br> + (NSCharacterSet*) <b>uppercaseLetterCharacterSet</b>;<br>
<p>
Returns a character set that contains the uppercase characters.
This set does not include caseless characters, only those that
have corresponding characters in lowercase and/or titlecase.
</p>
<hr> <hr>
<h3><a name ="method-14">whitespaceAndNewlineCharacterSet</a></h3> <h3><a name ="method-14">whitespaceAndNewlineCharacterSet</a></h3>
+ (NSCharacterSet*) <b>whitespaceAndNewlineCharacterSet</b>;<br> + (NSCharacterSet*) <b>whitespaceAndNewlineCharacterSet</b>;<br>
<p>
Returns a character set that contains the whitespace characters,
plus the newline characters, values 0x000A and 0x000D.
</p>
<hr> <hr>
<h3><a name ="method-15">whitespaceCharacterSet</a></h3> <h3><a name ="method-15">whitespaceCharacterSet</a></h3>
+ (NSCharacterSet*) <b>whitespaceCharacterSet</b>;<br> + (NSCharacterSet*) <b>whitespaceCharacterSet</b>;<br>
<p>
Returns a character set that contains the whitespace characters.
</p>
<hr> <hr>
<hr><h2>Instances Methods </h2> <hr><h2>Instances Methods </h2>
<h3><a name ="method-16">bitmapRepresentation</a></h3> <h3><a name ="method-16">bitmapRepresentation</a></h3>
- (NSData*) <b>bitmapRepresentation</b>;<br> - (NSData*) <b>bitmapRepresentation</b>;<br>
<p>
Returns a bitmap representation of the receiver's character set
suitable for archiving or writing to a file, in an NSData object.
</p>
<hr> <hr>
<h3><a name ="method-17">characterIsMember:</a></h3> <h3><a name ="method-17">characterIsMember:</a></h3>
- (BOOL) <b>characterIsMember:</b> (unichar)aCharacter;<br> - (BOOL) <b>characterIsMember:</b> (unichar)aCharacter;<br>
<p>
Returns YES if the receiver contains <em>aCharacter</em>, NO if
it does not.
</p>
<hr> <hr>
<h3><a name ="method-18">invertedSet</a></h3> <h3><a name ="method-18">invertedSet</a></h3>
- (NSCharacterSet*) <b>invertedSet</b>;<br> - (NSCharacterSet*) <b>invertedSet</b>;<br>
<p>
Returns a character set containing only characters that the
receiver does not contain.
</p>
<hr> <hr>
</body> </body>

View file

@ -12,7 +12,39 @@
</head> </head>
<body> <body>
<chapter> <chapter>
<heading>NSFunctions</heading> <heading>Functions</heading>
</chapter>
<chapter>
<heading>Types</heading>
<type name="NSRange">
<typespec>
struct { unsigned long location; unsigned long length; }
</typespec>
<declared>Foundation/NSRange.h</declared>
<desc>
<p>
The NSRange type is used to specify ranges of locations,
typically items in an array, characters in a string, and bytes
in a data object.
</p>
<p>
As 'boundary' or 'fencepost' errors are a particularly common
problem in programming, it is important that you understand
how an NSRange works.
</p>
<p>
An NSRange consists of a location and a length. The points
that are considered to lie in a range are the integers from
the location to the location plus the length, so the number
of points in a range is the length of the range plus one.<br />
However, if you consider these points like the marks on a
ruler, you can only store information <strong>between</strong>
points. So the number of items that can be stored in a range
is the length of the range.
</p>
</desc>
<standards><OpenStep/><MacOS-X/><GNUstep/></standards>
</type>
</chapter> </chapter>
</body> </body>
</gsdoc> </gsdoc>

View file

@ -11,7 +11,43 @@
</dl> </dl>
<p>Version: $Revision$</p> <p>Version: $Revision$</p>
<p>Date: $Date$</p> <p>Date: $Date$</p>
<h2><a name ="cont-0">NSFunctions</a></h2> <h2><a name ="cont-0">Functions</a></h2>
<h2><a name ="cont-1">Types</a></h2>
<h3><a name ="NSRange">NSRange</a></h3>
<p><b>Declared in: </b> Foundation/NSRange.h</p>
<b>typedef </b>
struct { unsigned long location; unsigned long length; }
NSRange<br>
<p>
The NSRange type is used to specify ranges of locations,
typically items in an array, characters in a string, and bytes
in a data object.
</p>
<p>
As 'boundary' or 'fencepost' errors are a particularly common
problem in programming, it is important that you understand
how an NSRange works.
</p>
<p>
An NSRange consists of a location and a length. The points
that are considered to lie in a range are the integers from
the location to the location plus the length, so the number
of points in a range is the length of the range plus one.<br>
However, if you consider these points like the marks on a
ruler, you can only store information <strong>between</strong>
points. So the number of items that can be stored in a range
is the length of the range.
</p>
<hr>
</body> </body>
</html> </html>

View file

@ -71,6 +71,16 @@
<method type="void*"> <method type="void*">
<sel>mutableBytes</sel> <sel>mutableBytes</sel>
<desc> <desc>
Returns a pointer to the data storage of the receiver.<br />
Modifications to the memory pointed to by this pointer will
change the contents of the object. It is important that
your code should not try to modify the memory beyond the
number of bytes given by the <code>-length</code> method.<br />
NB. if the object is released, or any method that changes its
size or content is called, then the pointer previously returned
by this method may cease to be valid.<br />
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
</desc> </desc>
</method> </method>
<method type="void"> <method type="void">
@ -79,6 +89,16 @@
<sel>withBytes:</sel> <sel>withBytes:</sel>
<arg type="const void*">bytes</arg> <arg type="const void*">bytes</arg>
<desc> <desc>
Replaces the bytes of data in the specified range with a
copy of the new bytes supplied.<br />
If the location of the range specified lies beyond the end
of the data (<code>[self length] &lt; range.location</code>)
then a range exception is raised.<br />
Otherwise, if the range specified extends beyond the end
of the data, then the size of the data is increased to
accomodate the new bytes.<br />
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
</desc> </desc>
</method> </method>
<method type="void"> <method type="void">

View file

@ -91,11 +91,31 @@
<h3><a name ="method-8">mutableBytes</a></h3> <h3><a name ="method-8">mutableBytes</a></h3>
- (void*) <b>mutableBytes</b>;<br> - (void*) <b>mutableBytes</b>;<br>
Returns a pointer to the data storage of the receiver.<br>
Modifications to the memory pointed to by this pointer will
change the contents of the object. It is important that
your code should not try to modify the memory beyond the
number of bytes given by the <code>-length</code> method.<br>
NB. if the object is released, or any method that changes its
size or content is called, then the pointer previously returned
by this method may cease to be valid.<br>
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
<hr> <hr>
<h3><a name ="method-9">replaceBytesInRange:withBytes:</a></h3> <h3><a name ="method-9">replaceBytesInRange:withBytes:</a></h3>
- (void) <b>replaceBytesInRange:</b> (NSRange)range <b>withBytes:</b> (const void*)bytes;<br> - (void) <b>replaceBytesInRange:</b> (NSRange)range <b>withBytes:</b> (const void*)bytes;<br>
Replaces the bytes of data in the specified range with a
copy of the new bytes supplied.<br>
If the location of the range specified lies beyond the end
of the data (<code>[self length] &#60; range.location</code>)
then a range exception is raised.<br>
Otherwise, if the range specified extends beyond the end
of the data, then the size of the data is increased to
accomodate the new bytes.<br>
This is a 'primitive' method ... you need to implement it
if you write a subclass of NSMutableData.
<hr> <hr>
<h3><a name ="method-10">resetBytesInRange:</a></h3> <h3><a name ="method-10">resetBytesInRange:</a></h3>

View file

@ -151,6 +151,9 @@ Standards: GNUstep<br>
<h3><a name ="method-12">instanceMethodSignatureForSelector:</a></h3> <h3><a name ="method-12">instanceMethodSignatureForSelector:</a></h3>
+ (NSMethodSignature*) <b>instanceMethodSignatureForSelector:</b> (SEL)aSelector;<br> + (NSMethodSignature*) <b>instanceMethodSignatureForSelector:</b> (SEL)aSelector;<br>
Returns a method signature object representing the
method implemented for instsances of this class which
corresponds to the supplied selector.
<hr> <hr>
<h3><a name ="method-13">instancesRespondToSelector:</a></h3> <h3><a name ="method-13">instancesRespondToSelector:</a></h3>
@ -316,6 +319,9 @@ Standards: GNUstep<br>
<h3><a name ="method-38">methodSignatureForSelector:</a></h3> <h3><a name ="method-38">methodSignatureForSelector:</a></h3>
- (NSMethodSignature*) <b>methodSignatureForSelector:</b> (SEL)aSelector;<br> - (NSMethodSignature*) <b>methodSignatureForSelector:</b> (SEL)aSelector;<br>
Returns a method signature object representing the
method implemented in this object which corresponds to
the supplied selector.
<hr> <hr>
<h3><a name ="method-39">mutableCopy</a></h3> <h3><a name ="method-39">mutableCopy</a></h3>

View file

@ -18,10 +18,11 @@
@node Introduction, Configuration, Top, Top @node Introduction, Configuration, Top, Top
@section Introduction @section Introduction
If you are installing this package as part of the GNUstep core If you are installing this package as part of the GNUstep core packages,
package, read the file GNUstep-HOWTO for more complete instructions on read the file GNUstep-HOWTO for more complete instructions on how to
how to install the entire GNUstep package (including this library). install the entire GNUstep package (including this library).
GNUstep-HOWTO is located at @url{www.gnustep.org} GNUstep-HOWTO is located in the gnustep-make package or at
@url{http://www.gnustep.org}
If you are installing the GNUstep libraries individually, make sure you If you are installing the GNUstep libraries individually, make sure you
have installed the GNUstep Makefile package (gnustep-make) already. have installed the GNUstep Makefile package (gnustep-make) already.
@ -38,10 +39,10 @@ shell prompt. You may want to use some of the optional arguments to the
for a list of these. It is not likely that you will need to use the for a list of these. It is not likely that you will need to use the
@code{--prefix} option, since gstep-base will automatically install in @code{--prefix} option, since gstep-base will automatically install in
the directory specified by the @code{GNUSTEP_SYSTEM_ROOT} environment the directory specified by the @code{GNUSTEP_SYSTEM_ROOT} environment
variable (specified when you installed gstep-make). variable (specified when you installed gnustep-make).
Some configuration options for the base library need to be specified Some configuration options for the base library need to be specified
when configuring the gstep-make package. In most cases, it is a good when configuring the gnustep-make package. In most cases, it is a good
idea to specify the same configuration options when configuring both idea to specify the same configuration options when configuring both
packages, just to make sure. packages, just to make sure.

View file

@ -7,11 +7,24 @@
The currently released version of the library is The currently released version of the library is
@samp{@value{GNUSTEP-BASE-VERSION}}. @samp{@value{GNUSTEP-BASE-VERSION}}.
@section Noteworthy changes in version @samp{1.0.0}
@itemize @bullet
@item Fix parsing of arguments for new linux kernels.
@item File manager and other fixes for mingw
@item Fix alignment issues on CPUs that require it.
@item Update unicode support and fixes
@end itemize
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.9.1} @section Noteworthy changes in version @samp{0.9.1}
@itemize @bullet @itemize @bullet
@item New MacOSX compatible files for NSCalendarDate, NSTimeZone @item New MacOSX compatible files for NSCalendarDate, NSTimeZone
@item NSUserDefaults noew uses NSLanguages not Languages @item NSUserDefaults now uses NSLanguages not Languages
@item Various improvements for Windows platforms @item Various improvements for Windows platforms
@item NSCharacterSets updated to v3.0.1 of Unicode data. @item NSCharacterSets updated to v3.0.1 of Unicode data.
@item Added some gettext compatible localization macros. @item Added some gettext compatible localization macros.
@ -26,10 +39,6 @@ The currently released version of the library is
@item Updated for Makefile package changes. @item Updated for Makefile package changes.
@end itemize @end itemize
@c ====================================================================
@c Keep the next line just below the list of changes in most recent version.
@ifclear ANNOUNCE-ONLY
@section Noteworthy changes in version @samp{0.9.0} @section Noteworthy changes in version @samp{0.9.0}
@itemize @bullet @itemize @bullet

View file

@ -30,12 +30,14 @@
#if BUILD_libgnustep_base_DLL #if BUILD_libgnustep_base_DLL
# define GS_EXPORT __declspec(dllexport) # define GS_EXPORT __declspec(dllexport)
# define GS_DECLARE __declspec(dllexport)
#elif libgnustep_base_ISDLL #elif libgnustep_base_ISDLL
# define GS_EXPORT extern __declspec(dllimport) # define GS_EXPORT extern __declspec(dllimport)
# define GS_DECLARE __declspec(dllimport)
#else #else
# define GS_EXPORT extern # define GS_EXPORT extern
# define GS_DECLARE
#endif #endif
#define GS_DECLARE
@class NSObject; @class NSObject;
@class NSString; @class NSString;

View file

@ -140,14 +140,21 @@
@end @end
NSObject *NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone); GS_EXPORT NSObject *
void NSDeallocateObject(NSObject *anObject); NSAllocateObject(Class aClass, unsigned extraBytes, NSZone *zone);
NSObject *NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone); GS_EXPORT void
NSDeallocateObject(NSObject *anObject);
GS_EXPORT NSObject *
NSCopyObject(NSObject *anObject, unsigned extraBytes, NSZone *zone);
BOOL NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone); GS_EXPORT BOOL
unsigned NSExtraRefCount(id anObject); NSShouldRetainWithZone(NSObject *anObject, NSZone *requestedZone);
void NSIncrementExtraRefCount(id anObject); GS_EXPORT unsigned
BOOL NSDecrementExtraRefCountWasZero(id anObject); NSExtraRefCount(id anObject);
GS_EXPORT void
NSIncrementExtraRefCount(id anObject);
GS_EXPORT BOOL
NSDecrementExtraRefCountWasZero(id anObject);
typedef enum _NSComparisonResult typedef enum _NSComparisonResult
{ {

View file

@ -99,7 +99,7 @@ NSMakeRange(unsigned int location, unsigned int length)
if (end < location || end < length) if (end < location || end < length)
{ {
extern void _NSRangeExceptionRaise (); GS_EXPORT void _NSRangeExceptionRaise ();
/* NB: The implementation of _NSRangeExceptionRaise is: /* NB: The implementation of _NSRangeExceptionRaise is:
[NSException raise: NSRangeException [NSException raise: NSRangeException
format: @"Range location + length too great"]; */ format: @"Range location + length too great"]; */

View file

@ -2,9 +2,10 @@ Introduction
============ ============
If you are installing this package as part of the GNUstep core If you are installing this package as part of the GNUstep core
package, read the file GNUstep-HOWTO for more complete instructions on packages, read the file GNUstep-HOWTO for more complete instructions on
how to install the entire GNUstep package (including this library). how to install the entire GNUstep package (including this library).
GNUstep-HOWTO is located at <www.gnustep.org> GNUstep-HOWTO is located in the gnustep-make package or at
<http://www.gnustep.org>
If you are installing the GNUstep libraries individually, make sure If you are installing the GNUstep libraries individually, make sure
you have installed the GNUstep Makefile package (gnustep-make) already. you have installed the GNUstep Makefile package (gnustep-make) already.
@ -21,10 +22,10 @@ shell prompt. You may want to use some of the optional arguments to the
not likely that you will need to use the `--prefix' option, since not likely that you will need to use the `--prefix' option, since
gstep-base will automatically install in the directory specified by the gstep-base will automatically install in the directory specified by the
`GNUSTEP_SYSTEM_ROOT' environment variable (specified when you `GNUSTEP_SYSTEM_ROOT' environment variable (specified when you
installed gstep-make). installed gnustep-make).
Some configuration options for the base library need to be specified Some configuration options for the base library need to be specified
when configuring the gstep-make package. In most cases, it is a good when configuring the gnustep-make package. In most cases, it is a good
idea to specify the same configuration options when configuring both idea to specify the same configuration options when configuring both
packages, just to make sure. packages, just to make sure.

15
NEWS
View file

@ -1,14 +1,25 @@
News News
**** ****
The currently released version of the library is `0.9.2'. The currently released version of the library is `1.0.0'.
Noteworthy changes in version `1.0.0'
=====================================
* Fix parsing of arguments for new linux kernels.
* File manager and other fixes for mingw
* Fix alignment issues on CPUs that require it.
* Update unicode support and fixes
Noteworthy changes in version `0.9.1' Noteworthy changes in version `0.9.1'
===================================== =====================================
* New MacOSX compatible files for NSCalendarDate, NSTimeZone * New MacOSX compatible files for NSCalendarDate, NSTimeZone
* NSUserDefaults noew uses NSLanguages not Languages * NSUserDefaults now uses NSLanguages not Languages
* Various improvements for Windows platforms * Various improvements for Windows platforms

View file

@ -1063,7 +1063,7 @@ static Class runLoopClass;
} }
else else
{ {
NSLog(@"No messages to write on 0x%x.", self); // NSLog(@"No messages to write on 0x%x.", self);
return; return;
} }
} }

View file

@ -165,7 +165,7 @@
size = objc_sizeof_type(objctype); size = objc_sizeof_type(objctype);
rep = [NSData dataWithBytes: data length: size]; rep = [NSData dataWithBytes: data length: size];
return [NSString stringWithFormat: @"(%@) %@", objctype, [rep description]]; return [NSString stringWithFormat: @"(%s) %@", objctype, [rep description]];
} }
// NSCoding // NSCoding

View file

@ -1534,9 +1534,21 @@ failure:
withBytes: (const void*)bytes withBytes: (const void*)bytes
{ {
unsigned size = [self length]; unsigned size = [self length];
unsigned need = NSMaxRange(aRange);
GS_RANGE_CHECK(aRange, size); if (aRange.location > size)
memcpy([self mutableBytes] + aRange.location, bytes, aRange.length); {
[NSException raise: NSRangeException
format: @"location bad in replaceByteInRange:withBytes:"];
}
if (aRange.length > 0)
{
if (need > size)
{
[self setLength: need];
}
memcpy([self mutableBytes] + aRange.location, bytes, aRange.length);
}
} }
- (void) resetBytesInRange: (NSRange)aRange - (void) resetBytesInRange: (NSRange)aRange
@ -1551,7 +1563,7 @@ failure:
{ {
NSRange r = NSMakeRange(0, [data length]); NSRange r = NSMakeRange(0, [data length]);
[self setCapacity: [data length]]; [self setCapacity: r.length];
[self replaceBytesInRange: r withBytes: [data bytes]]; [self replaceBytesInRange: r withBytes: [data bytes]];
} }
@ -2691,8 +2703,22 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
- (void) replaceBytesInRange: (NSRange)aRange - (void) replaceBytesInRange: (NSRange)aRange
withBytes: (const void*)moreBytes withBytes: (const void*)moreBytes
{ {
GS_RANGE_CHECK(aRange, length); unsigned need = NSMaxRange(aRange);
memcpy(bytes + aRange.location, moreBytes, aRange.length);
if (aRange.location > capacity)
{
[NSException raise: NSRangeException
format: @"location bad in replaceByteInRange:withBytes:"];
}
if (aRange.length > 0)
{
if (need > length)
{
[self setCapacity: need];
length = need;
}
memcpy(bytes + aRange.location, moreBytes, aRange.length);
}
} }
- (void) serializeDataAt: (const void*)data - (void) serializeDataAt: (const void*)data
@ -3017,15 +3043,26 @@ getBytes(void* dst, void* src, unsigned len, unsigned limit, unsigned *pos)
return self; return self;
} }
- (void) setData: (NSData*)data
{
unsigned l = [data length];
[self setCapacity: l];
length = l;
memcpy(bytes, [data bytes], length);
}
- (void) setLength: (unsigned)size - (void) setLength: (unsigned)size
{ {
if (size > capacity) { if (size > capacity)
[self setCapacity: size]; {
[self setCapacity: size];
} }
if (size > length) { if (size > length)
memset(bytes + length, '\0', size - length); {
memset(bytes + length, '\0', size - length);
} }
length = size; length = size;
} }
@end @end

View file

@ -135,6 +135,15 @@
# include <utime.h> # include <utime.h>
#endif #endif
/*
* On systems that have the O_BINARY flag, use it for a binary copy.
*/
#if defined(O_BINARY)
#define GSBINIO O_BINARY
#else
#define GSBINIO 0
#endif
/* include usual headers */ /* include usual headers */
#include <Foundation/NSArray.h> #include <Foundation/NSArray.h>
@ -658,7 +667,7 @@ static NSFileManager* defaultManager = nil;
int len; int len;
int written; int written;
fd = open (cpath, O_WRONLY|O_TRUNC|O_CREAT, 0644); fd = open(cpath, GSBINIO|O_WRONLY|O_TRUNC|O_CREAT, 0644);
if (fd < 0) if (fd < 0)
{ {
return NO; return NO;
@ -920,7 +929,7 @@ static NSFileManager* defaultManager = nil;
- (NSDictionary*) fileSystemAttributesAtPath: (NSString*)path - (NSDictionary*) fileSystemAttributesAtPath: (NSString*)path
{ {
#if defined(__MINGW__) #if defined(__MINGW__)
long long totalsize, freesize; unsigned long long totalsize, freesize;
id values[5]; id values[5];
id keys[5] = { id keys[5] = {
NSFileSystemSize, NSFileSystemSize,
@ -937,11 +946,15 @@ static NSFileManager* defaultManager = nil;
&BytesPerSector, &NumberFreeClusters, &TotalNumberClusters)) &BytesPerSector, &NumberFreeClusters, &TotalNumberClusters))
return nil; return nil;
totalsize = TotalNumberClusters * SectorsPerCluster * BytesPerSector; totalsize = (unsigned long long)TotalNumberClusters
freesize = NumberFreeClusters * SectorsPerCluster * BytesPerSector; * (unsigned long long)SectorsPerCluster
* (unsigned long long)BytesPerSector;
freesize = (unsigned long long)NumberFreeClusters
* (unsigned long long)SectorsPerCluster
* (unsigned long long)BytesPerSector;
values[0] = [NSNumber numberWithLongLong: totalsize]; values[0] = [NSNumber numberWithUnsignedLongLong: totalsize];
values[1] = [NSNumber numberWithLongLong: freesize]; values[1] = [NSNumber numberWithUnsignedLongLong: freesize];
values[2] = [NSNumber numberWithLong: LONG_MAX]; values[2] = [NSNumber numberWithLong: LONG_MAX];
values[3] = [NSNumber numberWithLong: LONG_MAX]; values[3] = [NSNumber numberWithLong: LONG_MAX];
values[4] = [NSNumber numberWithUnsignedInt: 0]; values[4] = [NSNumber numberWithUnsignedInt: 0];
@ -956,7 +969,7 @@ static NSFileManager* defaultManager = nil;
#else #else
struct statfs statfsbuf; struct statfs statfsbuf;
#endif #endif
long long totalsize, freesize; unsigned long long totalsize, freesize;
const char* cpath = [self fileSystemRepresentationWithPath: path]; const char* cpath = [self fileSystemRepresentationWithPath: path];
id values[5]; id values[5];
@ -979,11 +992,13 @@ static NSFileManager* defaultManager = nil;
return nil; return nil;
#endif #endif
totalsize = statfsbuf.f_bsize * statfsbuf.f_blocks; totalsize = (unsigned long long) statfsbuf.f_bsize
freesize = statfsbuf.f_bsize * statfsbuf.f_bavail; * (unsigned long long) statfsbuf.f_blocks;
freesize = (unsigned long long) statfsbuf.f_bsize
* (unsigned long long) statfsbuf.f_bavail;
values[0] = [NSNumber numberWithLongLong: totalsize]; values[0] = [NSNumber numberWithUnsignedLongLong: totalsize];
values[1] = [NSNumber numberWithLongLong: freesize]; values[1] = [NSNumber numberWithUnsignedLongLong: freesize];
values[2] = [NSNumber numberWithLong: statfsbuf.f_files]; values[2] = [NSNumber numberWithLong: statfsbuf.f_files];
values[3] = [NSNumber numberWithLong: statfsbuf.f_ffree]; values[3] = [NSNumber numberWithLong: statfsbuf.f_ffree];
values[4] = [NSNumber numberWithUnsignedLong: statbuf.st_dev]; values[4] = [NSNumber numberWithUnsignedLong: statbuf.st_dev];
@ -1096,7 +1111,15 @@ static NSFileManager* defaultManager = nil;
#endif #endif
if (stat(cpath, &sb) != 0) if (stat(cpath, &sb) != 0)
ok = NO; {
ok = NO;
}
#if defined(__WIN32__)
else if (sb.st_mode & _S_IFDIR)
{
ok = YES; // Directories don't have modification times.
}
#endif
else else
{ {
#if defined(__WIN32__) || defined(_POSIX_VERSION) #if defined(__WIN32__) || defined(_POSIX_VERSION)
@ -1545,84 +1568,127 @@ static NSFileManager* defaultManager = nil;
- (BOOL) _copyFile: (NSString*)source - (BOOL) _copyFile: (NSString*)source
toFile: (NSString*)destination toFile: (NSString*)destination
handler: handler handler: (id)handler
{ {
NSDictionary* attributes; #if defined(__MINGW__)
int i, bufsize = 8096; if (CopyFile([self fileSystemRepresentationWithPath: source],
int sourceFd, destFd, fileSize, fileMode; [self fileSystemRepresentationWithPath: destination], NO))
int rbytes, wbytes; {
char buffer[bufsize]; return YES;
}
if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path",
@"cannot copy file", @"Error",
destination, @"ToPath",
nil];
return [handler fileManager: self
shouldProceedAfterError: errorInfo];
}
else
{
return NO;
}
#else
NSDictionary *attributes;
int i;
int bufsize = 8096;
int sourceFd;
int destFd;
int fileSize;
int fileMode;
int rbytes;
int wbytes;
char buffer[bufsize];
/* Assumes source is a file and exists! */ /* Assumes source is a file and exists! */
NSAssert1 ([self fileExistsAtPath: source], NSAssert1 ([self fileExistsAtPath: source],
@"source file '%@' does not exist!", source); @"source file '%@' does not exist!", source);
attributes = [self _attributesAtPath: source traverseLink: NO forCopy: YES]; attributes = [self _attributesAtPath: source traverseLink: NO forCopy: YES];
NSAssert1 (attributes, @"could not get the attributes for file '%@'", NSAssert1 (attributes, @"could not get the attributes for file '%@'",
source); source);
fileSize = [[attributes objectForKey: NSFileSize] intValue]; fileSize = [[attributes objectForKey: NSFileSize] intValue];
fileMode = [[attributes objectForKey: NSFilePosixPermissions] intValue]; fileMode = [[attributes objectForKey: NSFilePosixPermissions] intValue];
/* Open the source file. In case of error call the handler. */ /* Open the source file. In case of error call the handler. */
sourceFd = open ([self fileSystemRepresentationWithPath: source], O_RDONLY); sourceFd = open([self fileSystemRepresentationWithPath: source],
if (sourceFd < 0) { GSBINIO|O_RDONLY);
if (handler) { if (sourceFd < 0)
NSDictionary* errorInfo {
= [NSDictionary dictionaryWithObjectsAndKeys: if (handler != nil)
{
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path", source, @"Path",
@"cannot open file for reading", @"Error", @"cannot open file for reading", @"Error",
nil]; nil];
return [handler fileManager: self return [handler fileManager: self
shouldProceedAfterError: errorInfo]; shouldProceedAfterError: errorInfo];
} }
else else
{
return NO; return NO;
} }
}
/* Open the destination file. In case of error call the handler. */ /* Open the destination file. In case of error call the handler. */
destFd = open ([self fileSystemRepresentationWithPath: destination], destFd = open([self fileSystemRepresentationWithPath: destination],
O_WRONLY|O_CREAT|O_TRUNC, fileMode); GSBINIO|O_WRONLY|O_CREAT|O_TRUNC, fileMode);
if (destFd < 0) { if (destFd < 0)
if (handler) { {
NSDictionary* errorInfo if (handler != nil)
= [NSDictionary dictionaryWithObjectsAndKeys: {
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
destination, @"ToPath", destination, @"ToPath",
@"cannot open file for writing", @"Error", @"cannot open file for writing", @"Error",
nil]; nil];
close (sourceFd); close (sourceFd);
return [handler fileManager: self return [handler fileManager: self
shouldProceedAfterError: errorInfo]; shouldProceedAfterError: errorInfo];
} }
else else
{
return NO; return NO;
} }
}
/* Read bufsize bytes from source file and write them into the destination /* Read bufsize bytes from source file and write them into the destination
file. In case of errors call the handler and abort the operation. */ file. In case of errors call the handler and abort the operation. */
for (i = 0; i < fileSize; i += rbytes) { for (i = 0; i < fileSize; i += rbytes)
{
rbytes = read (sourceFd, buffer, bufsize); rbytes = read (sourceFd, buffer, bufsize);
if (rbytes < 0) { if (rbytes < 0)
if (handler) { {
NSDictionary* errorInfo if (handler != nil)
= [NSDictionary dictionaryWithObjectsAndKeys: {
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path", source, @"Path",
@"cannot read from file", @"Error", @"cannot read from file", @"Error",
nil]; nil];
close (sourceFd); close (sourceFd);
close (destFd); close (destFd);
return [handler fileManager: self return [handler fileManager: self
shouldProceedAfterError: errorInfo]; shouldProceedAfterError: errorInfo];
} }
else else
{
return NO; return NO;
} }
}
wbytes = write (destFd, buffer, rbytes); wbytes = write (destFd, buffer, rbytes);
if (wbytes != rbytes) { if (wbytes != rbytes)
if (handler) { {
NSDictionary* errorInfo if (handler != nil)
= [NSDictionary dictionaryWithObjectsAndKeys: {
NSDictionary *errorInfo
= [NSDictionary dictionaryWithObjectsAndKeys:
source, @"Path", source, @"Path",
destination, @"ToPath", destination, @"ToPath",
@"cannot write to file", @"Error", @"cannot write to file", @"Error",
@ -1630,16 +1696,19 @@ static NSFileManager* defaultManager = nil;
close (sourceFd); close (sourceFd);
close (destFd); close (destFd);
return [handler fileManager: self return [handler fileManager: self
shouldProceedAfterError: errorInfo]; shouldProceedAfterError: errorInfo];
} }
else else
{
return NO; return NO;
} }
} }
}
close (sourceFd); close (sourceFd);
close (destFd); close (destFd);
return YES; return YES;
#endif
} }
- (BOOL) _copyPath: (NSString*)source - (BOOL) _copyPath: (NSString*)source
@ -1762,18 +1831,29 @@ static NSFileManager* defaultManager = nil;
NSFileGroupOwnerAccountNumber NSFileGroupOwnerAccountNumber
}; };
#if defined(__MINGW__)
if (stat(cpath, &statbuf) != 0)
{
return nil;
}
#else /* !(__MINGW__) */
if (traverse) if (traverse)
{ {
if (stat(cpath, &statbuf) != 0) if (stat(cpath, &statbuf) != 0)
return nil; {
return nil;
}
} }
#ifdef S_IFLNK #ifdef S_IFLNK
else else
{ {
if (lstat(cpath, &statbuf) != 0) if (lstat(cpath, &statbuf) != 0)
return nil; {
return nil;
}
} }
#endif #endif /* (S_IFLNK) */
#endif /* (__MINGW__) */
values[0] = [NSNumber numberWithUnsignedLongLong: statbuf.st_size]; values[0] = [NSNumber numberWithUnsignedLongLong: statbuf.st_size];
values[1] = [NSDate dateWithTimeIntervalSince1970: statbuf.st_mtime]; values[1] = [NSDate dateWithTimeIntervalSince1970: statbuf.st_mtime];

View file

@ -105,30 +105,28 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
// Does not block // Does not block
- (BOOL) tryLock - (BOOL) tryLock
{ {
/* Return NO if we're already locked */
if (_mutex->owner == objc_thread_id())
{
return NO;
}
// Ask the runtime to acquire a lock on the mutex // Ask the runtime to acquire a lock on the mutex
if (objc_mutex_trylock(_mutex) == -1) if (objc_mutex_trylock(_mutex) == -1)
{ {
return NO; return NO;
} }
else return YES;
{
/*
* The recursive lock check goes here to support openstep's
* implementation. In openstep you can lock in one thread trylock in the
* same thread and have another thread release the lock.
*
* This is dangerous and broken IMHO.
*/
CHECK_RECURSIVE_LOCK(_mutex);
return YES;
}
} }
- (BOOL) lockBeforeDate: (NSDate *)limit - (BOOL) lockBeforeDate: (NSDate *)limit
{ {
int x; int x;
while ((x = objc_mutex_trylock(_mutex)) == -1) /* This is really the behavior of OpenStep, if the current thread has
the lock, we just block until the time limit is up. Very odd */
while (_mutex->owner == objc_thread_id()
|| (x = objc_mutex_trylock(_mutex)) == -1)
{ {
NSDate *current = [NSDate date]; NSDate *current = [NSDate date];
NSComparisonResult compare; NSComparisonResult compare;
@ -144,14 +142,6 @@ NSString *NSRecursiveLockException = @"NSRecursiveLockException";
*/ */
sleep(1); sleep(1);
} }
/*
* The recursive lock check goes here to support openstep's implementation.
* In openstep you can lock in one thread trylock in the same thread and have
* another thread release the lock.
*
* This is dangerous and broken IMHO.
*/
CHECK_RECURSIVE_LOCK(_mutex);
return YES; return YES;
} }

View file

@ -36,8 +36,13 @@
+ (NSMethodSignature*) signatureWithObjCTypes: (const char*)t + (NSMethodSignature*) signatureWithObjCTypes: (const char*)t
{ {
NSMethodSignature *newMs = [[NSMethodSignature alloc] autorelease]; NSMethodSignature *newMs;
if (t == 0 || *t == '\0')
{
return nil;
}
newMs = AUTORELEASE([NSMethodSignature alloc]);
newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength, newMs->_methodTypes = mframe_build_signature(t, &newMs->_argFrameLength,
&newMs->_numArgs, 0); &newMs->_numArgs, 0);

View file

@ -756,14 +756,29 @@ static BOOL deallocNotifications = NO;
const char *types; const char *types;
struct objc_method *mth; struct objc_method *mth;
if (aSelector == 0)
{
return nil;
}
mth = (GSObjCIsInstance(self) mth = (GSObjCIsInstance(self)
? class_get_instance_method(GSObjCClass(self), aSelector) ? class_get_instance_method(GSObjCClass(self), aSelector)
: class_get_class_method(GSObjCClass(self), aSelector)); : class_get_class_method(GSObjCClass(self), aSelector));
if (mth == 0) if (mth == 0)
{
types = 0;
}
else
{
types = mth->method_types;
}
if (types == 0)
{
types = aSelector->sel_types;
}
if (types == 0)
{ {
return nil; return nil;
} }
types = mth->method_types;
return [NSMethodSignature signatureWithObjCTypes: types]; return [NSMethodSignature signatureWithObjCTypes: types];
} }

View file

@ -268,6 +268,7 @@ static char **_gnu_noobjc_env;
char *proc_file_name = NULL; char *proc_file_name = NULL;
FILE *ifp; FILE *ifp;
int c; int c;
int last;
int argument; int argument;
int length; int length;
int position; int position;
@ -323,6 +324,7 @@ static char **_gnu_noobjc_env;
ifp = fopen(proc_file_name, "r"); ifp = fopen(proc_file_name, "r");
if (ifp == NULL) if (ifp == NULL)
goto proc_fs_error; goto proc_fs_error;
last = 0;
while (1) while (1)
{ {
c = getc(ifp); c = getc(ifp);
@ -330,9 +332,11 @@ static char **_gnu_noobjc_env;
_gnu_noobjc_argc++; _gnu_noobjc_argc++;
else if (c == EOF) else if (c == EOF)
break; break;
last = c;
} }
#ifndef __FreeBSD__ #ifndef __FreeBSD__
_gnu_noobjc_argc++; if (last != 0)
_gnu_noobjc_argc++;
#endif #endif
/* /*
* Now _gnu_noobcj_argc is the number of arguments; * Now _gnu_noobcj_argc is the number of arguments;
@ -352,7 +356,7 @@ static char **_gnu_noobjc_env;
} }
argument = 0; argument = 0;
length = 0; length = 0;
while (1) while (argument < _gnu_noobjc_argc)
{ {
c = getc(ifp); c = getc(ifp);
length++; length++;
@ -362,7 +366,7 @@ static char **_gnu_noobjc_env;
if (_gnu_noobjc_argv[argument] == NULL) if (_gnu_noobjc_argv[argument] == NULL)
goto malloc_error; goto malloc_error;
argument++; argument++;
if (c == EOF) // End of command line if (argument == _gnu_noobjc_argc || c == EOF) // End of command line
break; break;
length = 0; length = 0;
} }

View file

@ -70,7 +70,7 @@ NSStringFromRange(NSRange range)
range.location, range.length]; range.location, range.length];
} }
void _NSRangeExceptionRaise () GS_EXPORT void _NSRangeExceptionRaise ()
{ {
[NSException raise: NSRangeException [NSException raise: NSRangeException
format: @"Range location + length too great"]; format: @"Range location + length too great"];

View file

@ -210,6 +210,21 @@ serializeToInfo(id object, _NSSerializerInfo* info)
(*info->serImp)(info->data, serSel, slen); (*info->serImp)(info->data, serSel, slen);
dlen = (*info->lenImp)(info->data, lenSel); dlen = (*info->lenImp)(info->data, lenSel);
(*info->setImp)(info->data, setSel, dlen + slen*sizeof(unichar)); (*info->setImp)(info->data, setSel, dlen + slen*sizeof(unichar));
#if NEED_WORD_ALIGNMENT
/*
* When packing data, an item may not be aligned on a
* word boundary, so we work with an aligned buffer
* and use memcmpy()
*/
if ((dlen % __alignof__(gsu32)) != 0)
{
unichar buffer[slen];
[object getCharacters: buffer];
memcpy((*info->datImp)(info->data, datSel) + dlen, buffer,
slen*sizeof(unichar));
}
else
#endif
[object getCharacters: (*info->datImp)(info->data, datSel) + dlen]; [object getCharacters: (*info->datImp)(info->data, datSel) + dlen];
if (info->shouldUnique) if (info->shouldUnique)
GSIMapAddPair(&info->map, GSIMapAddPair(&info->map,

View file

@ -142,7 +142,13 @@ static inline int
decode (const void *ptr) decode (const void *ptr)
{ {
#if defined(WORDS_BIGENDIAN) && SIZEOF_INT == 4 #if defined(WORDS_BIGENDIAN) && SIZEOF_INT == 4
#if NEED_WORD_ALIGNMENT
int value;
memcpy(&value, ptr, sizeof(int));
return value;
#else
return *(const int *) ptr; return *(const int *) ptr;
#endif
#else /* defined(WORDS_BIGENDIAN) && SIZEOF_INT == 4 */ #else /* defined(WORDS_BIGENDIAN) && SIZEOF_INT == 4 */
const unsigned char *p = ptr; const unsigned char *p = ptr;
int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0; int result = *p & (1 << (CHAR_BIT - 1)) ? ~0 : 0;

View file

@ -54,6 +54,14 @@ ADDITIONAL_LDFLAGS =
# Additional library directories the linker should search # Additional library directories the linker should search
ADDITIONAL_LIB_DIRS = -L../Source/$(GNUSTEP_OBJ_DIR) ADDITIONAL_LIB_DIRS = -L../Source/$(GNUSTEP_OBJ_DIR)
ifeq ($(GNUSTEP_TARGET_OS),mingw32)
BUNDLE_LIBS += -lgnustep-base -lobjc
endif
ifeq ($(GNUSTEP_TARGET_OS),cygwin)
BUNDLE_LIBS += -lgnustep-base -lobjc
endif
# #
# Flags dealing with installing and uninstalling # Flags dealing with installing and uninstalling
# #

View file

@ -2,9 +2,10 @@
#include <stdio.h> #include <stdio.h>
#if 0 #if 1
int main () int main ()
{ {
id pool = [NSAutoreleasePool new];
id o = [NSObject new]; id o = [NSObject new];
printf ("Hello from object at 0x%x\n", (unsigned)[o self]); printf ("Hello from object at 0x%x\n", (unsigned)[o self]);
exit (0); exit (0);

View file

@ -14,7 +14,7 @@ main()
id o1, o2, o3; id o1, o2, o3;
unsigned int p; unsigned int p;
behavior_set_debug(0); //behavior_set_debug(0);
[NSAutoreleasePool enableDoubleReleaseCheck:YES]; [NSAutoreleasePool enableDoubleReleaseCheck:YES];
pool = [[NSAutoreleasePool alloc] init]; pool = [[NSAutoreleasePool alloc] init];

View file

@ -14,18 +14,24 @@
#include "Foundation/NSException.h" #include "Foundation/NSException.h"
#include "Foundation/NSString.h" #include "Foundation/NSString.h"
#include <Foundation/NSAutoreleasePool.h> #include <Foundation/NSAutoreleasePool.h>
#include <Foundation/NSProcessInfo.h>
#include "LoadMe.h" #include "LoadMe.h"
#include "SecondClass.h" #include "SecondClass.h"
#include "MyCategory.h" #include "MyCategory.h"
int int
main(int ac, char *av[]) main(int argc, char *argv[], char **env)
{ {
NSBundle *main; NSBundle *main;
NSBundle *bundle; NSBundle *bundle;
NSString *path; NSString *path;
id object; id object;
NSAutoreleasePool *arp = [NSAutoreleasePool new]; NSAutoreleasePool *arp;
#if LIB_FOUNDATION_LIBRARY || defined(GS_PASS_ARGUMENTS)
[NSProcessInfo initializeWithArguments:argv count:argc environment:env];
#endif
arp = [NSAutoreleasePool new];
main = [NSBundle mainBundle]; main = [NSBundle mainBundle];
printf("Looking for main bundle...\n"); printf("Looking for main bundle...\n");

View file

@ -21,7 +21,7 @@ main()
id a, b, c, e; /* dates */ id a, b, c, e; /* dates */
id pool; id pool;
behavior_set_debug(0); //behavior_set_debug(0);
pool = [[NSAutoreleasePool alloc] init]; pool = [[NSAutoreleasePool alloc] init];

View file

@ -47,7 +47,7 @@ main(int argc, char** argv, char** envp)
printf("%s ", [b cString]); printf("%s ", [b cString]);
printf("\n"); printf("\n");
behavior_set_debug(0); //behavior_set_debug(0);
objects = [NSArray arrayWithObjects: objects = [NSArray arrayWithObjects:
@"vache", @"poisson", @"cheval", @"poulet", nil]; @"vache", @"poisson", @"cheval", @"poulet", nil];

View file

@ -9,6 +9,7 @@
#include <Foundation/NSException.h> #include <Foundation/NSException.h>
#include <Foundation/NSString.h> #include <Foundation/NSString.h>
#include <Foundation/NSThread.h> #include <Foundation/NSThread.h>
#include <Foundation/NSAutoreleasePool.h>
#define N 10 /* Number of threads */ #define N 10 /* Number of threads */
#define MAX_ITER 10000.0 /* Max number of iterations. */ #define MAX_ITER 10000.0 /* Max number of iterations. */
@ -36,19 +37,23 @@ FILE *file;
- (void)runWith: (id)thing - (void)runWith: (id)thing
{ {
int i, n; int i, n;
CREATE_AUTORELEASE_POOL(pool);
NS_DURING NS_DURING
n = 1+(int)((MAX_ITER*rand())/(RAND_MAX+1.0)); n = 1+(int)((MAX_ITER*rand())/(RAND_MAX+1.0));
fflush(stdout);
for (i = 0; i < n; i++) for (i = 0; i < n; i++)
{ {
fprintf(file, "%d ", i); fprintf(file, "%d ", i);
fflush(file); fflush(file);
} }
fflush(stdout);
[NSException raise: @"Some exception" format: @"thread %d", ident]; [NSException raise: @"Some exception" format: @"thread %d", ident];
NS_HANDLER NS_HANDLER
printf("%s: %s for thread %d\n", [[localException name] cString], printf("%s: %s for thread %d\n", [[localException name] cString],
[[localException reason] cString], ident); [[localException reason] cString], ident);
NS_ENDHANDLER NS_ENDHANDLER
DESTROY(pool);
[NSThread exit]; [NSThread exit];
} }
@ -58,6 +63,7 @@ int main()
{ {
int i; int i;
SingleThread *threads[N]; SingleThread *threads[N];
CREATE_AUTORELEASE_POOL(pool);
printf("We run %d threads.\n", N); printf("We run %d threads.\n", N);
printf("Some of them might not raise exceptions,\n"); printf("Some of them might not raise exceptions,\n");
@ -81,5 +87,6 @@ int main()
printf("There's a runaway exception! Something is wrong!\n"); printf("There's a runaway exception! Something is wrong!\n");
NS_ENDHANDLER NS_ENDHANDLER
fclose(file); fclose(file);
DESTROY(pool);
return 0; return 0;
} }

10
Version
View file

@ -5,14 +5,14 @@
GCC_VERSION=2.8.0 GCC_VERSION=2.8.0
# The version number of this release. # The version number of this release.
MAJOR_VERSION=0 MAJOR_VERSION=1
MINOR_VERSION=9 MINOR_VERSION=0
SUBMINOR_VERSION=3 SUBMINOR_VERSION=0
GNUSTEP_BASE_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION} GNUSTEP_BASE_VERSION=${MAJOR_VERSION}.${MINOR_VERSION}.${SUBMINOR_VERSION}
VERSION=${GNUSTEP_BASE_VERSION} VERSION=${GNUSTEP_BASE_VERSION}
GNUSTEP_BASE_FTP_MACHINE=ftp.gnustep.org GNUSTEP_BASE_FTP_MACHINE=ftp.gnustep.org
GNUSTEP_BASE_FTP_DIRECTORY=pub/gnustep/core GNUSTEP_BASE_FTP_DIRECTORY=pub/gnustep/core
GNUSTEP_BASE_SNAP_FTP_MACHINE=alpha.gnu.org GNUSTEP_BASE_SNAP_FTP_MACHINE=ftp.gnustep.org
GNUSTEP_BASE_SNAP_FTP_DIRECTORY=gnu/gnustep GNUSTEP_BASE_SNAP_FTP_DIRECTORY=pub/daily-snapshots

756
config.guess vendored

File diff suppressed because it is too large Load diff

257
config.sub vendored
View file

@ -1,8 +1,10 @@
#! /bin/sh #! /bin/sh
# Configuration validation subroutine script, version 1.1. # Configuration validation subroutine script.
# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000 # Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
# Free Software Foundation, Inc. # Free Software Foundation, Inc.
#
timestamp='2001-03-30'
# This file is (in principle) common to ALL GNU software. # This file is (in principle) common to ALL GNU software.
# The presence of a machine in this file suggests that SOME GNU software # The presence of a machine in this file suggests that SOME GNU software
# can handle that machine. It does not imply ALL GNU software can. # can handle that machine. It does not imply ALL GNU software can.
@ -27,7 +29,6 @@
# configuration script generated by Autoconf, you may include it under # configuration script generated by Autoconf, you may include it under
# the same distribution terms that you use for the rest of that program. # the same distribution terms that you use for the rest of that program.
# Written by Per Bothner <bothner@cygnus.com>.
# Please send patches to <config-patches@gnu.org>. # Please send patches to <config-patches@gnu.org>.
# #
# Configuration subroutine to validate and canonicalize a configuration type. # Configuration subroutine to validate and canonicalize a configuration type.
@ -50,30 +51,73 @@
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM # CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification. # It is wrong to echo any other type of specification.
if [ x$1 = x ] me=`echo "$0" | sed -e 's,.*/,,'`
then
echo Configuration name missing. 1>&2
echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
echo "or $0 ALIAS" 1>&2
echo where ALIAS is a recognized configuration type. 1>&2
exit 1
fi
# First pass through any local machine types. usage="\
case $1 in Usage: $0 [OPTION] CPU-MFR-OPSYS
*local*) $0 [OPTION] ALIAS
echo $1
exit 0 Canonicalize a configuration name.
;;
*) Operation modes:
;; -h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
Report bugs and patches to <config-patches@gnu.org>."
version="\
GNU config.sub ($timestamp)
Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
Try \`$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
case $1 in
--time-stamp | --time* | -t )
echo "$timestamp" ; exit 0 ;;
--version | -v )
echo "$version" ; exit 0 ;;
--help | --h* | -h )
echo "$usage"; exit 0 ;;
-- ) # Stop option processing
shift; break ;;
- ) # Use stdin as input.
break ;;
-* )
echo "$me: invalid option $1$help"
exit 1 ;;
*local*)
# First pass through any local machine types.
echo $1
exit 0;;
* )
break ;;
esac
done
case $# in
0) echo "$me: missing argument$help" >&2
exit 1;;
1) ;;
*) echo "$me: too many arguments$help" >&2
exit 1;;
esac esac
# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). # Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
# Here we must recognize all the valid KERNEL-OS combinations. # Here we must recognize all the valid KERNEL-OS combinations.
maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
case $maybe_os in case $maybe_os in
linux-gnu*) nto-qnx* | linux-gnu* | storm-chaos* | os2-emx*)
os=-$maybe_os os=-$maybe_os
basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
;; ;;
@ -99,7 +143,7 @@ case $os in
-convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
-c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
-harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \
-apple) -apple | -axis)
os= os=
basic_machine=$1 basic_machine=$1
;; ;;
@ -171,27 +215,39 @@ esac
case $basic_machine in case $basic_machine in
# Recognize the basic CPU types without company name. # Recognize the basic CPU types without company name.
# Some are omitted here because they have special meanings below. # Some are omitted here because they have special meanings below.
tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc | arm \ tahoe | i860 | ia64 | m32r | m68k | m68000 | m88k | ns32k | arc \
| arme[lb] | pyramid | mn10200 | mn10300 | tron | a29k \ | arm | arme[lb] | arm[bl]e | armv[2345] | armv[345][lb] | strongarm | xscale \
| pyramid | mn10200 | mn10300 | tron | a29k \
| 580 | i960 | h8300 \ | 580 | i960 | h8300 \
| x86 | ppcbe | mipsbe | mipsle | shbe | shle \
| hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \ | hppa | hppa1.0 | hppa1.1 | hppa2.0 | hppa2.0w | hppa2.0n \
| alpha | alphaev[4-7] | alphaev56 | alphapca5[67] \ | hppa64 \
| we32k | ns16k | clipper | i370 | sh | powerpc | powerpcle \ | alpha | alphaev[4-8] | alphaev56 | alphapca5[67] \
| 1750a | dsp16xx | pdp11 | mips16 | mips64 | mipsel | mips64el \ | alphaev6[78] \
| we32k | ns16k | clipper | i370 | sh | sh[34] \
| powerpc | powerpcle \
| 1750a | dsp16xx | pdp10 | pdp11 \
| mips16 | mips64 | mipsel | mips64el \
| mips64orion | mips64orionel | mipstx39 | mipstx39el \ | mips64orion | mips64orionel | mipstx39 | mipstx39el \
| mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \ | mips64vr4300 | mips64vr4300el | mips64vr4100 | mips64vr4100el \
| mips64vr5000 | miprs64vr5000el | mcore \ | mips64vr5000 | miprs64vr5000el | mcore | s390 | s390x \
| sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \ | sparc | sparclet | sparclite | sparc64 | sparcv9 | v850 | c4x \
| thumb | d10v | fr30) | thumb | d10v | d30v | fr30 | avr | openrisc | tic80 \
| pj | pjl | h8500)
basic_machine=$basic_machine-unknown basic_machine=$basic_machine-unknown
;; ;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | h8500 | w65 | pj | pjl) m6811 | m68hc11 | m6812 | m68hc12)
# Motorola 68HC11/12.
basic_machine=$basic_machine-unknown
os=-none
;;
m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | z8k | v70 | w65)
;; ;;
# We use `pc' rather than `unknown' # We use `pc' rather than `unknown'
# because (1) that's what they normally are, and # because (1) that's what they normally are, and
# (2) the word "unknown" tends to confuse beginning users. # (2) the word "unknown" tends to confuse beginning users.
i[34567]86) i[234567]86 | x86_64)
basic_machine=$basic_machine-pc basic_machine=$basic_machine-pc
;; ;;
# Object if more than one company name word. # Object if more than one company name word.
@ -201,23 +257,29 @@ case $basic_machine in
;; ;;
# Recognize the basic CPU types with company name. # Recognize the basic CPU types with company name.
# FIXME: clean up the formatting here. # FIXME: clean up the formatting here.
vax-* | tahoe-* | i[34567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \ vax-* | tahoe-* | i[234567]86-* | i860-* | ia64-* | m32r-* | m68k-* | m68000-* \
| m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | arm-* | c[123]* \ | m88k-* | sparc-* | ns32k-* | fx80-* | arc-* | c[123]* \
| arm-* | armbe-* | armle-* | armv*-* | strongarm-* | xscale-* \
| mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* \
| power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \ | power-* | none-* | 580-* | cray2-* | h8300-* | h8500-* | i960-* \
| xmp-* | ymp-* \ | xmp-* | ymp-* \
| hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* | hppa2.0n-* \ | x86-* | ppcbe-* | mipsbe-* | mipsle-* | shbe-* | shle-* \
| alpha-* | alphaev[4-7]-* | alphaev56-* | alphapca5[67]-* \ | hppa-* | hppa1.0-* | hppa1.1-* | hppa2.0-* | hppa2.0w-* \
| hppa2.0n-* | hppa64-* \
| alpha-* | alphaev[4-8]-* | alphaev56-* | alphapca5[67]-* \
| alphaev6[78]-* \
| we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \ | we32k-* | cydra-* | ns16k-* | pn-* | np1-* | xps100-* \
| clipper-* | orion-* \ | clipper-* | orion-* \
| sparclite-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \ | sparclite-* | pdp10-* | pdp11-* | sh-* | powerpc-* | powerpcle-* \
| sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \ | sparc64-* | sparcv9-* | sparc86x-* | mips16-* | mips64-* | mipsel-* \
| mips64el-* | mips64orion-* | mips64orionel-* \ | mips64el-* | mips64orion-* | mips64orionel-* \
| mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \ | mips64vr4100-* | mips64vr4100el-* | mips64vr4300-* | mips64vr4300el-* \
| mipstx39-* | mipstx39el-* | mcore-* \ | mipstx39-* | mipstx39el-* | mcore-* \
| f301-* | armv*-* | t3e-* \ | f30[01]-* | f700-* | s390-* | s390x-* | sv1-* | t3e-* \
| [cjt]90-* \
| m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \ | m88110-* | m680[01234]0-* | m683?2-* | m68360-* | z8k-* | d10v-* \
| thumb-* | v850-* | d30v-* | tic30-* | c30-* | fr30-* ) | thumb-* | v850-* | d30v-* | tic30-* | tic80-* | c30-* | fr30-* \
| bs2000-* | tic54x-* | c54x-* | x86_64-* | pj-* | pjl-*)
;; ;;
# Recognize the various machine names and aliases which stand # Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS. # for a CPU type and a company and sometimes even an OS.
@ -254,14 +316,14 @@ case $basic_machine in
os=-sysv os=-sysv
;; ;;
amiga | amiga-*) amiga | amiga-*)
basic_machine=m68k-cbm basic_machine=m68k-unknown
;; ;;
amigaos | amigados) amigaos | amigados)
basic_machine=m68k-cbm basic_machine=m68k-unknown
os=-amigaos os=-amigaos
;; ;;
amigaunix | amix) amigaunix | amix)
basic_machine=m68k-cbm basic_machine=m68k-unknown
os=-sysv4 os=-sysv4
;; ;;
apollo68) apollo68)
@ -308,13 +370,16 @@ case $basic_machine in
basic_machine=cray2-cray basic_machine=cray2-cray
os=-unicos os=-unicos
;; ;;
[ctj]90-cray) [cjt]90)
basic_machine=c90-cray basic_machine=${basic_machine}-cray
os=-unicos os=-unicos
;; ;;
crds | unos) crds | unos)
basic_machine=m68k-crds basic_machine=m68k-crds
;; ;;
cris | cris-* | etrax*)
basic_machine=cris-axis
;;
da30 | da30-*) da30 | da30-*)
basic_machine=m68k-da30 basic_machine=m68k-da30
;; ;;
@ -362,6 +427,10 @@ case $basic_machine in
basic_machine=tron-gmicro basic_machine=tron-gmicro
os=-sysv os=-sysv
;; ;;
go32)
basic_machine=i386-pc
os=-go32
;;
h3050r* | hiux*) h3050r* | hiux*)
basic_machine=hppa1.1-hitachi basic_machine=hppa1.1-hitachi
os=-hiuxwe2 os=-hiuxwe2
@ -461,17 +530,6 @@ case $basic_machine in
basic_machine=i386-unknown basic_machine=i386-unknown
os=-vsta os=-vsta
;; ;;
i386-go32 | go32)
basic_machine=i386-unknown
os=-go32
;;
i386-mingw32 | mingw32)
basic_machine=i386-unknown
os=-mingw32
;;
i386-qnx | qnx)
basic_machine=i386-qnx
;;
iris | iris4d) iris | iris4d)
basic_machine=mips-sgi basic_machine=mips-sgi
case $os in case $os in
@ -497,6 +555,10 @@ case $basic_machine in
basic_machine=ns32k-utek basic_machine=ns32k-utek
os=-sysv os=-sysv
;; ;;
mingw32)
basic_machine=i386-pc
os=-mingw32
;;
miniframe) miniframe)
basic_machine=m68000-convergent basic_machine=m68000-convergent
;; ;;
@ -527,7 +589,7 @@ case $basic_machine in
os=-coff os=-coff
;; ;;
msdos) msdos)
basic_machine=i386-unknown basic_machine=i386-pc
os=-msdos os=-msdos
;; ;;
mvs) mvs)
@ -591,9 +653,16 @@ case $basic_machine in
basic_machine=i960-intel basic_machine=i960-intel
os=-mon960 os=-mon960
;; ;;
nonstopux)
basic_machine=mips-compaq
os=-nonstopux
;;
np1) np1)
basic_machine=np1-gould basic_machine=np1-gould
;; ;;
nsr-tandem)
basic_machine=nsr-tandem
;;
op50n-* | op60c-*) op50n-* | op60c-*)
basic_machine=hppa1.1-oki basic_machine=hppa1.1-oki
os=-proelf os=-proelf
@ -623,28 +692,28 @@ case $basic_machine in
pc532 | pc532-*) pc532 | pc532-*)
basic_machine=ns32k-pc532 basic_machine=ns32k-pc532
;; ;;
pentium | p5 | k5 | k6 | nexen) pentium | p5 | k5 | k6 | nexgen)
basic_machine=i586-pc basic_machine=i586-pc
;; ;;
pentiumpro | p6 | 6x86) pentiumpro | p6 | 6x86 | athlon)
basic_machine=i686-pc basic_machine=i686-pc
;; ;;
pentiumii | pentium2) pentiumii | pentium2)
basic_machine=i786-pc basic_machine=i686-pc
;; ;;
pentium-* | p5-* | k5-* | k6-* | nexen-*) pentium-* | p5-* | k5-* | k6-* | nexgen-*)
basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumpro-* | p6-* | 6x86-*) pentiumpro-* | p6-* | 6x86-* | athlon-*)
basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pentiumii-* | pentium2-*) pentiumii-* | pentium2-*)
basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
;; ;;
pn) pn)
basic_machine=pn-gould basic_machine=pn-gould
;; ;;
power) basic_machine=rs6000-ibm power) basic_machine=power-ibm
;; ;;
ppc) basic_machine=powerpc-unknown ppc) basic_machine=powerpc-unknown
;; ;;
@ -659,6 +728,10 @@ case $basic_machine in
ps2) ps2)
basic_machine=i386-ibm basic_machine=i386-ibm
;; ;;
pw32)
basic_machine=i586-unknown
os=-pw32
;;
rom68k) rom68k)
basic_machine=m68k-rom68k basic_machine=m68k-rom68k
os=-coff os=-coff
@ -738,6 +811,10 @@ case $basic_machine in
sun386 | sun386i | roadrunner) sun386 | sun386i | roadrunner)
basic_machine=i386-sun basic_machine=i386-sun
;; ;;
sv1)
basic_machine=sv1-cray
os=-unicos
;;
symmetry) symmetry)
basic_machine=i386-sequent basic_machine=i386-sequent
os=-dynix os=-dynix
@ -746,6 +823,10 @@ case $basic_machine in
basic_machine=t3e-cray basic_machine=t3e-cray
os=-unicos os=-unicos
;; ;;
tic54x | c54x*)
basic_machine=tic54x-unknown
os=-coff
;;
tx39) tx39)
basic_machine=mipstx39-unknown basic_machine=mipstx39-unknown
;; ;;
@ -841,12 +922,19 @@ case $basic_machine in
vax) vax)
basic_machine=vax-dec basic_machine=vax-dec
;; ;;
pdp10)
# there are many clones, so DEC is not a safe bet
basic_machine=pdp10-unknown
;;
pdp11) pdp11)
basic_machine=pdp11-dec basic_machine=pdp11-dec
;; ;;
we32k) we32k)
basic_machine=we32k-att basic_machine=we32k-att
;; ;;
sh3 | sh4)
basic_machine=sh-unknown
;;
sparc | sparcv9) sparc | sparcv9)
basic_machine=sparc-sun basic_machine=sparc-sun
;; ;;
@ -869,6 +957,9 @@ case $basic_machine in
basic_machine=c4x-none basic_machine=c4x-none
os=-coff os=-coff
;; ;;
*-unknown)
# Make sure to match an already-canonicalized machine name.
;;
*) *)
echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
exit 1 exit 1
@ -927,9 +1018,23 @@ case $os in
| -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \
| -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \
| -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \ | -mingw32* | -linux-gnu* | -uxpv* | -beos* | -mpeix* | -udk* \
| -interix* | -uwin* | -rhapsody* | -opened* | -openstep* | -oskit*) | -interix* | -uwin* | -rhapsody* | -darwin* | -opened* \
| -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \
| -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* | -os2*)
# Remember, each alternative MUST END IN *, to match a version number. # Remember, each alternative MUST END IN *, to match a version number.
;; ;;
-qnx*)
case $basic_machine in
x86-* | i[34567]86-*)
;;
*)
os=-nto$os
;;
esac
;;
-nto*)
os=-nto-qnx
;;
-sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \
| -windows* | -osx | -abug | -netware* | -os9* | -beos* \ | -windows* | -osx | -abug | -netware* | -os9* | -beos* \
| -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*)
@ -949,6 +1054,9 @@ case $os in
-opened*) -opened*)
os=-openedition os=-openedition
;; ;;
-wince*)
os=-wince
;;
-osfrose*) -osfrose*)
os=-osfrose os=-osfrose
;; ;;
@ -973,6 +1081,9 @@ case $os in
-ns2 ) -ns2 )
os=-nextstep2 os=-nextstep2
;; ;;
-nsk*)
os=-nsk
;;
# Preserve the version number of sinix5. # Preserve the version number of sinix5.
-sinix5.*) -sinix5.*)
os=`echo $os | sed -e 's|sinix|sysv|'` os=`echo $os | sed -e 's|sinix|sysv|'`
@ -986,9 +1097,6 @@ case $os in
-oss*) -oss*)
os=-sysv3 os=-sysv3
;; ;;
-qnx)
os=-qnx4
;;
-svr4) -svr4)
os=-sysv4 os=-sysv4
;; ;;
@ -1010,7 +1118,7 @@ case $os in
-xenix) -xenix)
os=-xenix os=-xenix
;; ;;
-*mint | -*MiNT) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
os=-mint os=-mint
;; ;;
-none) -none)
@ -1044,6 +1152,9 @@ case $basic_machine in
arm*-semi) arm*-semi)
os=-aout os=-aout
;; ;;
pdp10-*)
os=-tops20
;;
pdp11-*) pdp11-*)
os=-none os=-none
;; ;;
@ -1152,7 +1263,7 @@ case $basic_machine in
*-masscomp) *-masscomp)
os=-rtu os=-rtu
;; ;;
f301-fujitsu) f30[01]-fujitsu | f700-fujitsu)
os=-uxpv os=-uxpv
;; ;;
*-rom68k) *-rom68k)
@ -1230,7 +1341,7 @@ case $basic_machine in
-mpw* | -macos*) -mpw* | -macos*)
vendor=apple vendor=apple
;; ;;
-*mint | -*MiNT) -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
vendor=atari vendor=atari
;; ;;
esac esac
@ -1239,3 +1350,11 @@ case $basic_machine in
esac esac
echo $basic_machine$os echo $basic_machine$os
exit 0
# Local variables:
# eval: (add-hook 'write-file-hooks 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
# End: