1997-06-04 20:57  Ulrich Drepper  <drepper@cygnus.com>

	* manual/string.texi: Add comments to discourage use of index and
	rindex.
	(strtok, strsep): Apply function on copy of the strings in example.
	(l64a): Add example.

	* posix/unistd.h: Correct value for _POSIX_VERSION.

	* sunrpc/Makefile (defines): Remove definition.

	* sysdeps/ieee754/nan.h: Correct typo.

1997-06-04 10:50  Fila Kolodny  <fila@ibi.com>

	* posix/unistd.h: Add definition of __fchdir corresponding to fchdir.

	* login/utmp_daemon.c: Correct location of utmpd.h.

1997-06-03 19:16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* Makerules: Rename $(common-objpfx)distinfo-$(subdir) to
	$(objpfx)distinfo.
	* rpm/Makefile (distinfo): Adapted.

1997-06-03 18:32  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* rpm/Makefile (install-slib): Collect shared libraries here
	instead of in install-lib, including libc.
	(instvars): Add slib.

1997-06-03 18:23  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* login/Makefile (libutil-routines): Add updwtmp.

1997-06-03 16:16  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* monetary.h: New file, needed for localedata/tst-fmon.c.

1997-06-02 20:31  Andreas Schwab  <schwab@issan.informatik.uni-dortmund.de>

	* math/libm-test.c (cpow_test): Add epsilon for long double in
	test for 2^10.
	(identities): Add epsilon for float in second identity test.

	* sysdeps/m68k/huge_val.h: Change GCC's HUGE_VAL{,F,L} to use
	DI and SI mode integers instead of bytes.  Fix value of HUGE_VALL.

	* sysdeps/m68k/nan.h: New file.

	* sysdeps/m68k/fpu/__math.h (isgreater, isgreaterequal, isless,
	islessequal, islessgreater, isunordered): Fix assembler syntax.

	* sysdeps/m68k/fpu/fraiseexcpt.c: Do it right so that gcc doesn't
	optimize out the operations.

	* sysdeps/libm-ieee754/s_nan.c: Use NaN macro instead of static
	constant.
	* sysdeps/libm-ieee754/s_nanf.c: Likewise.
	* sysdeps/libm-ieee754/s_nanl.c: Likewise.

	* math/carg.c [NO_LONG_DOUBLE]: Add alias for long double
	function.
	* sysdeps/libm-ieee754/s_erf.c: Likewise.
	* sysdeps/libm-ieee754/s_fdim.c: Likewise.
	* sysdeps/libm-ieee754/s_fmax.c: Likewise.
	* sysdeps/libm-ieee754/s_fmin.c: Likewise.
	* sysdeps/libm-ieee754/s_log2.c: Likewise.
	* sysdeps/libm-ieee754/s_nan.c: Likewise.
	* sysdeps/libm-ieee754/s_remquo.c: Likewise.
This commit is contained in:
Ulrich Drepper 1997-06-04 19:05:38 +00:00
parent 2a7b5469dd
commit 5649a1d60d
24 changed files with 347 additions and 105 deletions

View File

@ -1,3 +1,74 @@
1997-06-04 20:57 Ulrich Drepper <drepper@cygnus.com>
* manual/string.texi: Add comments to discourage use of index and
rindex.
(strtok, strsep): Apply function on copy of the strings in example.
(l64a): Add example.
* posix/unistd.h: Correct value for _POSIX_VERSION.
* sunrpc/Makefile (defines): Remove definition.
* sysdeps/ieee754/nan.h: Correct typo.
1997-06-04 10:50 Fila Kolodny <fila@ibi.com>
* posix/unistd.h: Add definition of __fchdir corresponding to fchdir.
* login/utmp_daemon.c: Correct location of utmpd.h.
1997-06-03 19:16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* Makerules: Rename $(common-objpfx)distinfo-$(subdir) to
$(objpfx)distinfo.
* rpm/Makefile (distinfo): Adapted.
1997-06-03 18:32 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* rpm/Makefile (install-slib): Collect shared libraries here
instead of in install-lib, including libc.
(instvars): Add slib.
1997-06-03 18:23 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* login/Makefile (libutil-routines): Add updwtmp.
1997-06-03 16:16 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* monetary.h: New file, needed for localedata/tst-fmon.c.
1997-06-02 20:31 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
* math/libm-test.c (cpow_test): Add epsilon for long double in
test for 2^10.
(identities): Add epsilon for float in second identity test.
* sysdeps/m68k/huge_val.h: Change GCC's HUGE_VAL{,F,L} to use
DI and SI mode integers instead of bytes. Fix value of HUGE_VALL.
* sysdeps/m68k/nan.h: New file.
* sysdeps/m68k/fpu/__math.h (isgreater, isgreaterequal, isless,
islessequal, islessgreater, isunordered): Fix assembler syntax.
* sysdeps/m68k/fpu/fraiseexcpt.c: Do it right so that gcc doesn't
optimize out the operations.
* sysdeps/libm-ieee754/s_nan.c: Use NaN macro instead of static
constant.
* sysdeps/libm-ieee754/s_nanf.c: Likewise.
* sysdeps/libm-ieee754/s_nanl.c: Likewise.
* math/carg.c [NO_LONG_DOUBLE]: Add alias for long double
function.
* sysdeps/libm-ieee754/s_erf.c: Likewise.
* sysdeps/libm-ieee754/s_fdim.c: Likewise.
* sysdeps/libm-ieee754/s_fmax.c: Likewise.
* sysdeps/libm-ieee754/s_fmin.c: Likewise.
* sysdeps/libm-ieee754/s_log2.c: Likewise.
* sysdeps/libm-ieee754/s_nan.c: Likewise.
* sysdeps/libm-ieee754/s_remquo.c: Likewise.
1997-06-03 23:42 Ulrich Drepper <drepper@cygnus.com> 1997-06-03 23:42 Ulrich Drepper <drepper@cygnus.com>
* elf/dl-support.c: Define and initialize _dl_verbose used in * elf/dl-support.c: Define and initialize _dl_verbose used in

View File

@ -836,10 +836,10 @@ ALL_BUILD_CFLAGS = $(BUILD_CFLAGS) -include $(..)config.h
check: tests check: tests
.PHONY: TAGS .PHONY: TAGS
TAGS: $(common-objpfx)distinfo-$(subdir) $(..)MakeTAGS TAGS: $(objpfx)distinfo $(..)MakeTAGS
$(MAKE) $(addprefix -f ,$^) $@ $(MAKE) $(addprefix -f ,$^) $@
$(..)po/%.pot: $(common-objpfx)distinfo-$(subdir) $(..)MakeTAGS FORCE $(..)po/%.pot: $(objpfx)distinfo $(..)MakeTAGS FORCE
$(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@ $(MAKE) $(addprefix -f ,$(filter-out FORCE,$^)) $@
FORCE: FORCE:
@ -874,7 +874,7 @@ common-clean: common-mostlyclean
-rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles) -rm -f $(addprefix $(objpfx),$(generated)) $(+depfiles)
-rm -fr $(addprefix $(objpfx),$(generated-dirs)) -rm -fr $(addprefix $(objpfx),$(generated-dirs))
-rm -f $(addprefix $(common-objpfx),$(common-generated)) -rm -f $(addprefix $(common-objpfx),$(common-generated))
-rm -f $(common-objpfx)distinfo-$(subdir) -rm -f $(objpfx)distinfo
# Produce a file `stub-$(subdir)' which contains `#define __stub_FUNCTION' # Produce a file `stub-$(subdir)' which contains `#define __stub_FUNCTION'
# for each function which is a stub. We grovel over all the .d files # for each function which is a stub. We grovel over all the .d files
@ -897,7 +897,7 @@ $(common-objpfx)stub-$(subdir): $(+depfiles)
# Make the distribution tar file. # Make the distribution tar file.
.PHONY: dist .PHONY: dist
dist: $(common-objpfx)distinfo-$(subdir) $(..)Make-dist dist: $(objpfx)distinfo $(..)Make-dist
$(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args) $(MAKE) -f $< -f $(word 2,$^) $(Make-dist-args)
# Avoid depending on source files found in sysdeps dirs, # Avoid depending on source files found in sysdeps dirs,
@ -908,14 +908,12 @@ dist: $(filter-out %.c %.S %.s,$(distribute))
# environment get too large. Instead, we write all the information into # environment get too large. Instead, we write all the information into
# a generated makefile fragment `distinfo', and then include it with -f in # a generated makefile fragment `distinfo', and then include it with -f in
# the sub-make that makes the distribution (above). # the sub-make that makes the distribution (above).
$(common-objpfx)distinfo-$(subdir): Makefile $(..)Makerules \ $(objpfx)distinfo: Makefile $(..)Makerules \
$(wildcard $(foreach dir,$(sysdirs),\ $(wildcard $(foreach dir,$(sysdirs),$(dir)/Makefile))
$(dir)/Makefile))
$(distinfo-vars) $(distinfo-vars)
mv -f $@.new $@ mv -f $@.new $@
.PHONY: subdir_distinfo distinfo .PHONY: subdir_distinfo
subdir_distinfo: distinfo subdir_distinfo: $(objpfx)distinfo
distinfo: $(common-objpfx)distinfo-$(subdir)
define distinfo-vars define distinfo-vars
rm -f $@.new rm -f $@.new

View File

@ -42,7 +42,7 @@ vpath %.c programs
extra-libs := libutil extra-libs := libutil
extra-libs-others := $(extra-libs) extra-libs-others := $(extra-libs)
libutil-routines:= login login_tty logout logwtmp pty libutil-routines:= login login_tty logout logwtmp pty updwtmp
include ../Rules include ../Rules

View File

@ -27,7 +27,7 @@
#include <utmp.h> #include <utmp.h>
#include "utmp-private.h" #include "utmp-private.h"
#include "utmpd/utmpd.h" #include "programs/utmpd.h"
#ifndef _LIBC #ifndef _LIBC
#define __set_errno(val) errno = (val) #define __set_errno(val) errno = (val)

View File

@ -890,6 +890,9 @@ specifying a null character as the value of the @var{c} argument.
@comment BSD @comment BSD
@deftypefun {char *} index (const char *@var{string}, int @var{c}) @deftypefun {char *} index (const char *@var{string}, int @var{c})
@code{index} is another name for @code{strchr}; they are exactly the same. @code{index} is another name for @code{strchr}; they are exactly the same.
New code should always use @code{strchr} since this name is defined in
@w{ISO C} while @code{index} is a BSD invention which never was available
on @w{System V} derived systems.
@end deftypefun @end deftypefun
@comment string.h @comment string.h
@ -910,6 +913,9 @@ strrchr ("hello, world", 'l')
@comment BSD @comment BSD
@deftypefun {char *} rindex (const char *@var{string}, int @var{c}) @deftypefun {char *} rindex (const char *@var{string}, int @var{c})
@code{rindex} is another name for @code{strrchr}; they are exactly the same. @code{rindex} is another name for @code{strrchr}; they are exactly the same.
New code should always use @code{strrchr} since this name is defined in
@w{ISO C} while @code{rindex} is a BSD invention which never was available
on @w{System V} derived systems.
@end deftypefun @end deftypefun
@comment string.h @comment string.h
@ -1067,13 +1073,14 @@ Here is a simple example showing the use of @code{strtok}.
@dots{} @dots{}
char string[] = "words separated by spaces -- and, punctuation!"; const char string[] = "words separated by spaces -- and, punctuation!";
const char delimiters[] = " .,;:!-"; const char delimiters[] = " .,;:!-";
char *token; char *token, *cp;
@dots{} @dots{}
token = strtok (string, delimiters); /* token => "words" */ cp = strdupa (string); /* Make writable copy. */
token = strtok (cp, delimiters); /* token => "words" */
token = strtok (NULL, delimiters); /* token => "separated" */ token = strtok (NULL, delimiters); /* token => "separated" */
token = strtok (NULL, delimiters); /* token => "by" */ token = strtok (NULL, delimiters); /* token => "by" */
token = strtok (NULL, delimiters); /* token => "spaces" */ token = strtok (NULL, delimiters); /* token => "spaces" */
@ -1097,7 +1104,7 @@ pointer. Calling @code{strtok_r} with a null pointer for
@var{newstring} and leaving @var{save_ptr} between the calls unchanged @var{newstring} and leaving @var{save_ptr} between the calls unchanged
does the job without limiting reentrancy. does the job without limiting reentrancy.
This function was proposed for POSIX.1b and can be found on many systems This function is defined in POSIX-1 and can be found on many systems
which support multi-threading. which support multi-threading.
@end deftypefun @end deftypefun
@ -1123,14 +1130,14 @@ Here is how the above example looks like when @code{strsep} is used.
@dots{} @dots{}
char string[] = "words separated by spaces -- and, punctuation!"; const char string[] = "words separated by spaces -- and, punctuation!";
const char delimiters[] = " .,;:!-"; const char delimiters[] = " .,;:!-";
char *running; char *running;
char *token; char *token;
@dots{} @dots{}
running = string; running = strdupa (string);
token = strsep (&running, delimiters); /* token => "words" */ token = strsep (&running, delimiters); /* token => "words" */
token = strsep (&running, delimiters); /* token => "separated" */ token = strsep (&running, delimiters); /* token => "separated" */
token = strsep (&running, delimiters); /* token => "by" */ token = strsep (&running, delimiters); /* token => "by" */
@ -1180,13 +1187,66 @@ The function returns a pointer to a static buffer which contains the
string representing of the encoding of @var{n}. To encoded a series of string representing of the encoding of @var{n}. To encoded a series of
bytes the use should append the new string to the destination buffer. bytes the use should append the new string to the destination buffer.
@emph{Warning:} Since a static buffer is used this function should not @emph{Warning:} Since a static buffer is used this function should not
be used in multi-threaded programs. There is no thread-safe alternatice be used in multi-threaded programs. There is no thread-safe alternative
to this function in the C library. to this function in the C library.
@end deftypefun @end deftypefun
Alone the @code{l64a} function is not usable. To encode arbitrary
sequences of bytes one needs some more code and this could look like
this:
@smallexample
char *
encode (const void *buf, size_t len)
@{
/* @r{We know in advance how long the buffer has to be.} */
unsigned char *in = (unsigned char *) buf;
char *out = malloc (6 + ((len + 3) / 4) * 6 + 1);
char *cp = out;
/* @r{Encode the length.} */
memcpy (cp, l64a (len), 6);
cp += 6;
while (len > 3)
@{
unsigned long int n = *in++;
n = (n << 8) | *in++;
n = (n << 8) | *in++;
n = (n << 8) | *in++;
len -= 4;
/* @r{Using `htonl' is necessary so that the data can be}
@r{decoded even on machines with different byte order.} */
memcpy (cp, l64a (htonl (n)), 6);
cp += 6;
@}
if (len > 0)
@{
unsigned long int n = *in++;
if (--len > 0)
@{
n = (n << 8) | *in++;
if (--len > 0)
n = (n << 8) | *in;
@}
memcpy (cp, l64a (htonl (n)), 6);
cp += 6;
@}
*cp = '\0';
return out;
@}
@end smallexample
It is strange that the library does not provide the complete
functionality needed but so be it. There are some other encoding
methods which are much more widely used (UU encoding, Base64 encoding).
Generally, it is better to use one of these encodings.
To decode data produced with @code{l64a} the following function should be To decode data produced with @code{l64a} the following function should be
used. used.
@comment stdlib.h
@comment XPG
@deftypefun {long int} a64l (const char *@var{string}) @deftypefun {long int} a64l (const char *@var{string})
The parameter @var{string} should contain a string which was produced by The parameter @var{string} should contain a string which was produced by
a call to @code{l64a}. The function processes the next 6 characters and a call to @code{l64a}. The function processes the next 6 characters and
@ -1205,17 +1265,17 @@ characters.
@node Argz and Envz Vectors @node Argz and Envz Vectors
@section Argz and Envz Vectors @section Argz and Envz Vectors
@cindex argz vectors @cindex argz vectors (string vectors)
@cindex string vectors, null-character separated @cindex string vectors, null-character separated
@cindex argument vectors, null-character separated @cindex argument vectors, null-character separated
@dfn{argz vectors} are vectors of strings in a contiguous block of @dfn{argz vectors} are vectors of strings in a contiguous block of
memory, each element separated from its neighbors by null-characters memory, each element separated from its neighbors by null-characters
(@code{'\0'}). (@code{'\0'}).
@cindex envz vectors @cindex envz vectors (environment vectors)
@cindex environment vectors, null-character separated @cindex environment vectors, null-character separated
@dfn{Envz vectors} are an extension of argz vectors where each element is a @dfn{Envz vectors} are an extension of argz vectors where each element is a
name-value pair, separated by a @code{'='} character (as in a unix name-value pair, separated by a @code{'='} character (as in a Unix
environment). environment).
@menu @menu
@ -1247,13 +1307,17 @@ allocation error occurs.
@pindex argz.h @pindex argz.h
These functions are declared in the standard include file @file{argz.h}. These functions are declared in the standard include file @file{argz.h}.
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_create (char *const @var{argv}[], char **@var{argz}, size_t *@var{argz_len}) @deftypefun {error_t} argz_create (char *const @var{argv}[], char **@var{argz}, size_t *@var{argz_len})
The @code{argz_create} function converts the unix-style argument vector The @code{argz_create} function converts the Unix-style argument vector
@var{argv} (a vector of pointers to normal C strings, terminated by @var{argv} (a vector of pointers to normal C strings, terminated by
@code{(char *)0}; @pxref{Program Arguments}) into an argz vector with @code{(char *)0}; @pxref{Program Arguments}) into an argz vector with
the same elements, which is returned in @var{argz} and @var{argz_len}. the same elements, which is returned in @var{argz} and @var{argz_len}.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_create_sep (const char *@var{string}, int @var{sep}, char **@var{argz}, size_t *@var{argz_len}) @deftypefun {error_t} argz_create_sep (const char *@var{string}, int @var{sep}, char **@var{argz}, size_t *@var{argz_len})
The @code{argz_create_sep} function converts the null-terminated string The @code{argz_create_sep} function converts the null-terminated string
@var{string} into an argz vector (returned in @var{argz} and @var{string} into an argz vector (returned in @var{argz} and
@ -1261,14 +1325,18 @@ The @code{argz_create_sep} function converts the null-terminated string
character @var{sep}. character @var{sep}.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {size_t} argz_count (const char *@var{argz}, size_t @var{arg_len}) @deftypefun {size_t} argz_count (const char *@var{argz}, size_t @var{arg_len})
Returns the number of elements in the argz vector @var{argz} and Returns the number of elements in the argz vector @var{argz} and
@var{argz_len}. @var{argz_len}.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {void} argz_extract (char *@var{argz}, size_t @var{argz_len}, char **@var{argv}) @deftypefun {void} argz_extract (char *@var{argz}, size_t @var{argz_len}, char **@var{argv})
The @code{argz_extract} function converts the argz vector @var{argz} and The @code{argz_extract} function converts the argz vector @var{argz} and
@var{argz_len} into a unix-style argument vector stored in @var{argv}, @var{argz_len} into a Unix-style argument vector stored in @var{argv},
by putting pointers to every element in @var{argz} into successive by putting pointers to every element in @var{argz} into successive
positions in @var{argv}, followed by a terminator of @code{0}. positions in @var{argv}, followed by a terminator of @code{0}.
@var{Argv} must be pre-allocated with enough space to hold all the @var{Argv} must be pre-allocated with enough space to hold all the
@ -1281,6 +1349,8 @@ still active. This function is useful for passing the elements in
@var{argz} to an exec function (@pxref{Executing a File}). @var{argz} to an exec function (@pxref{Executing a File}).
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {void} argz_stringify (char *@var{argz}, size_t @var{len}, int @var{sep}) @deftypefun {void} argz_stringify (char *@var{argz}, size_t @var{len}, int @var{sep})
The @code{argz_stringify} converts @var{argz} into a normal string with The @code{argz_stringify} converts @var{argz} into a normal string with
the elements separated by the character @var{sep}, by replacing each the elements separated by the character @var{sep}, by replacing each
@ -1289,20 +1359,26 @@ string) with @var{sep}. This is handy for printing @var{argz} in a
readable manner. readable manner.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_add (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str}) @deftypefun {error_t} argz_add (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str})
The @code{argz_add} function adds the string @var{str} to the end of the The @code{argz_add} function adds the string @var{str} to the end of the
argz vector @code{*@var{argz}}, and updates @code{*@var{argz}} and argz vector @code{*@var{argz}}, and updates @code{*@var{argz}} and
@code{*@var{argz_len}} accordingly. @code{*@var{argz_len}} accordingly.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_add_sep (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str}, int @var{delim}) @deftypefun {error_t} argz_add_sep (char **@var{argz}, size_t *@var{argz_len}, const char *@var{str}, int @var{delim})
The @code{argz_add_sep} function is similar to @code{argz_add}, but The @code{argz_add_sep} function is similar to @code{argz_add}, but
@var{str} is split into separate elements in the result at occurances of @var{str} is split into separate elements in the result at occurances of
the character @var{delim}. This is useful, for instance, for the character @var{delim}. This is useful, for instance, for
adding the components of a unix search path to an argz vector, by using adding the components of a Unix search path to an argz vector, by using
a value of @code{':'} for @var{delim}. a value of @code{':'} for @var{delim}.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_append (char **@var{argz}, size_t *@var{argz_len}, const char *@var{buf}, size_t @var{buf_len}) @deftypefun {error_t} argz_append (char **@var{argz}, size_t *@var{argz_len}, const char *@var{buf}, size_t @var{buf_len})
The @code{argz_append} function appends @var{buf_len} bytes starting at The @code{argz_append} function appends @var{buf_len} bytes starting at
@var{buf} to the argz vector @code{*@var{argz}}, reallocating @var{buf} to the argz vector @code{*@var{argz}}, reallocating
@ -1310,6 +1386,8 @@ The @code{argz_append} function appends @var{buf_len} bytes starting at
@code{*@var{argz_len}}. @code{*@var{argz_len}}.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_delete (char **@var{argz}, size_t *@var{argz_len}, char *@var{entry}) @deftypefun {error_t} argz_delete (char **@var{argz}, size_t *@var{argz_len}, char *@var{entry})
If @var{entry} points to the beginning of one of the elements in the If @var{entry} points to the beginning of one of the elements in the
argz vector @code{*@var{argz}}, the @code{argz_delete} function will argz vector @code{*@var{argz}}, the @code{argz_delete} function will
@ -1319,6 +1397,8 @@ destructive argz functions usually reallocate their argz argument,
pointers into argz vectors such as @var{entry} will then become invalid. pointers into argz vectors such as @var{entry} will then become invalid.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {error_t} argz_insert (char **@var{argz}, size_t *@var{argz_len}, char *@var{before}, const char *@var{entry}) @deftypefun {error_t} argz_insert (char **@var{argz}, size_t *@var{argz_len}, char *@var{before}, const char *@var{entry})
The @code{argz_insert} function inserts the string @var{entry} into the The @code{argz_insert} function inserts the string @var{entry} into the
argz vector @code{*@var{argz}} at a point just before the existing argz vector @code{*@var{argz}} at a point just before the existing
@ -1330,6 +1410,8 @@ is @code{0}, @var{entry} is added to the end instead (as if by
@var{before} will result in @var{entry} being inserted at the beginning. @var{before} will result in @var{entry} being inserted at the beginning.
@end deftypefun @end deftypefun
@comment argz.h
@comment GNU
@deftypefun {char *} argz_next (char *@var{argz}, size_t @var{argz_len}, const char *@var{entry}) @deftypefun {char *} argz_next (char *@var{argz}, size_t @var{argz_len}, const char *@var{entry})
The @code{argz_next} function provides a convenient way of iterating The @code{argz_next} function provides a convenient way of iterating
over the elements in the argz vector @var{argz}. It returns a pointer over the elements in the argz vector @var{argz}. It returns a pointer
@ -1387,6 +1469,8 @@ fail) have a return type of @code{error_t}, and return either @code{0} or
@pindex envz.h @pindex envz.h
These functions are declared in the standard include file @file{envz.h}. These functions are declared in the standard include file @file{envz.h}.
@comment envz.h
@comment GNU
@deftypefun {char *} envz_entry (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name}) @deftypefun {char *} envz_entry (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name})
The @code{envz_entry} function finds the entry in @var{envz} with the name The @code{envz_entry} function finds the entry in @var{envz} with the name
@var{name}, and returns a pointer to the whole entry---that is, the argz @var{name}, and returns a pointer to the whole entry---that is, the argz
@ -1394,6 +1478,8 @@ element which begins with @var{name} followed by a @code{'='} character. If
there is no entry with that name, @code{0} is returned. there is no entry with that name, @code{0} is returned.
@end deftypefun @end deftypefun
@comment envz.h
@comment GNU
@deftypefun {char *} envz_get (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name}) @deftypefun {char *} envz_get (const char *@var{envz}, size_t @var{envz_len}, const char *@var{name})
The @code{envz_get} function finds the entry in @var{envz} with the name The @code{envz_get} function finds the entry in @var{envz} with the name
@var{name} (like @code{envz_entry}), and returns a pointer to the value @var{name} (like @code{envz_entry}), and returns a pointer to the value
@ -1401,6 +1487,8 @@ portion of that entry (following the @code{'='}). If there is no entry with
that name (or only a null entry), @code{0} is returned. that name (or only a null entry), @code{0} is returned.
@end deftypefun @end deftypefun
@comment envz.h
@comment GNU
@deftypefun {error_t} envz_add (char **@var{envz}, size_t *@var{envz_len}, const char *@var{name}, const char *@var{value}) @deftypefun {error_t} envz_add (char **@var{envz}, size_t *@var{envz_len}, const char *@var{name}, const char *@var{value})
The @code{envz_add} function adds an entry to @code{*@var{envz}} The @code{envz_add} function adds an entry to @code{*@var{envz}}
(updating @code{*@var{envz}} and @code{*@var{envz_len}}) with the name (updating @code{*@var{envz}} and @code{*@var{envz_len}}) with the name
@ -1410,6 +1498,8 @@ already exists in @var{envz}, it is removed first. If @var{value} is
(mentioned above). (mentioned above).
@end deftypefun @end deftypefun
@comment envz.h
@comment GNU
@deftypefun {error_t} envz_merge (char **@var{envz}, size_t *@var{envz_len}, const char *@var{envz2}, size_t @var{envz2_len}, int @var{override}) @deftypefun {error_t} envz_merge (char **@var{envz}, size_t *@var{envz_len}, const char *@var{envz2}, size_t @var{envz2_len}, int @var{override})
The @code{envz_merge} function adds each entry in @var{envz2} to @var{envz}, The @code{envz_merge} function adds each entry in @var{envz2} to @var{envz},
as if with @code{envz_add}, updating @code{*@var{envz}} and as if with @code{envz_add}, updating @code{*@var{envz}} and
@ -1421,6 +1511,8 @@ entry in @var{envz} can prevent an entry of the same name in @var{envz2} from
being added to @var{envz}, if @var{override} is false. being added to @var{envz}, if @var{override} is false.
@end deftypefun @end deftypefun
@comment envz.h
@comment GNU
@deftypefun {void} envz_strip (char **@var{envz}, size_t *@var{envz_len}) @deftypefun {void} envz_strip (char **@var{envz}, size_t *@var{envz_len})
The @code{envz_strip} function removes any null entries from @var{envz}, The @code{envz_strip} function removes any null entries from @var{envz},
updating @code{*@var{envz}} and @code{*@var{envz_len}}. updating @code{*@var{envz}} and @code{*@var{envz_len}}.

View File

@ -27,3 +27,7 @@ __carg (__complex__ double x)
return __atan2 (__imag__ x, __real__ x); return __atan2 (__imag__ x, __real__ x);
} }
weak_alias (__carg, carg) weak_alias (__carg, carg)
#ifdef NO_LONG_DOUBLE
strong_alias (__carg, __cargl)
weak_alias (__carg, cargl)
#endif

View File

@ -3915,7 +3915,8 @@ cpow_test (void)
check ("imag(cpow (1 + i0), (0 + i0)) = 0", __imag__ result, 0); check ("imag(cpow (1 + i0), (0 + i0)) = 0", __imag__ result, 0);
result = FUNC (cpow) (BUILD_COMPLEX (2, 0), BUILD_COMPLEX (10, 0)); result = FUNC (cpow) (BUILD_COMPLEX (2, 0), BUILD_COMPLEX (10, 0));
check ("real(cpow (2 + i0), (10 + i0)) = 1024", __real__ result, 1024); check_eps ("real(cpow (2 + i0), (10 + i0)) = 1024", __real__ result, 1024,
CHOOSE (2e-16L, 0, 0));
check ("imag(cpow (2 + i0), (10 + i0)) = 0", __imag__ result, 0); check ("imag(cpow (2 + i0), (10 + i0)) = 0", __imag__ result, 0);
} }
@ -4158,7 +4159,7 @@ static void
identities (void) identities (void)
{ {
identities1_test (0.2L, CHOOSE (1e-18L, 0, 2e-7)); identities1_test (0.2L, CHOOSE (1e-18L, 0, 2e-7));
identities1_test (0.9L, CHOOSE (1e-18L, 0, 0)); identities1_test (0.9L, CHOOSE (1e-18L, 0, 1e-7));
identities1_test (0, 0); identities1_test (0, 0);
identities1_test (-1, CHOOSE (1e-18L, 0, 1e-7)); identities1_test (-1, CHOOSE (1e-18L, 0, 1e-7));

View File

@ -30,14 +30,15 @@ __BEGIN_DECLS
/* These may be used to determine what facilities are present at compile time. /* These may be used to determine what facilities are present at compile time.
Their values can be obtained at run time from `sysconf'. */ Their values can be obtained at run time from `sysconf'. */
/* POSIX Standard approved as IEEE Std 1003.1 as of August, 1988 and /* POSIX Standard approved as ISO/IEC 9945-1 as of August, 1988 and
extended by P1003.1b (aka POSIX.4). */ extended by POSIX-1b (aka POSIX-4) and POSIX-1c (aka POSIX threads). */
#define _POSIX_VERSION 199309L #define _POSIX_VERSION 199506L
/* These are not #ifdef __USE_POSIX2 because they are /* These are not #ifdef __USE_POSIX2 because they are
in the theoretically application-owned namespace. */ in the theoretically application-owned namespace. */
#define _POSIX2_C_VERSION 199209L /* Invalid until 1003.2 is done. */ /* POSIX Standard approved as ISO/IEC 9945-2 as of December, 1993. */
#define _POSIX2_C_VERSION 199209L
/* If defined, the implementation supports the /* If defined, the implementation supports the
C Language Bindings Option. */ C Language Bindings Option. */
@ -287,6 +288,7 @@ extern int chdir __P ((__const char *__path));
#if defined __USE_BSD || defined __USE_XOPEN_EXTENDED #if defined __USE_BSD || defined __USE_XOPEN_EXTENDED
/* Change the process's working directory to the one FD is open on. */ /* Change the process's working directory to the one FD is open on. */
extern int __fchdir __P ((int __fd));
extern int fchdir __P ((int __fd)); extern int fchdir __P ((int __fd));
#endif #endif

View File

@ -9,8 +9,8 @@ include ../Makeconfig
include $(common-objpfx)soversions.mk include $(common-objpfx)soversions.mk
include $(common-objpfx)version.mk include $(common-objpfx)version.mk
distinfo := $(common-objpfx)distinfo- \ distinfo := $(common-objpfx)distinfo \
$(wildcard $(subdirs:%=$(common-objpfx)distinfo-%)) $(wildcard $(subdirs:%=$(common-objpfx)%/distinfo))
-include $(distinfo) -include $(distinfo)
config = $(config-machine)-$(config-vendor)-$(config-os) config = $(config-machine)-$(config-vendor)-$(config-os)
@ -32,14 +32,15 @@ install-others := $(-install-others) \
install-sysconf := $(filter $(sysconfdir)/%,$(install-others)) install-sysconf := $(filter $(sysconfdir)/%,$(install-others))
install-others := $(filter-out $(sysconfdir)/%,$(install-others)) install-others := $(filter-out $(sysconfdir)/%,$(install-others))
# Add the unversioned lib*.so's to install-lib. # Add the unversioned lib*.so's.
install-lib += $(install-lib.so) install-slib = $(install-lib.so)
# For each versioned lib*.so, add three files: # For each versioned lib*.so, add two files:
# lib*-VERSION.so, lib*.so.MAJOR, and lib*.so # lib*-VERSION.so and lib*.so.MAJOR
install-lib += $(foreach lib,$(versioned),\ install-slib += $(foreach lib,$(versioned),\
$(patsubst %.so,%-$(version).so,$(lib)) \ $(patsubst %.so,%-$(version).so,$(lib)) \
$(lib)$($(lib)-version) $(lib)) $(lib)$($(lib)-version))
install-lib += $(versioned)
# Add libc.a and libc_p.a. # Add libc.a and libc_p.a.
install-lib += $(foreach o,$(filter-out .so,$(object-suffixes)),\ install-lib += $(foreach o,$(filter-out .so,$(object-suffixes)),\
@ -48,18 +49,17 @@ install-lib += $(foreach o,$(filter-out .so,$(object-suffixes)),\
ifeq (yes,$(build-shared)) ifeq (yes,$(build-shared))
# Add libc.so itself, which is a special case in Makerules. # Add libc.so itself, which is a special case in Makerules.
ifndef libc.so-version ifndef libc.so-version
install-others += $(slibdir)/libc.so install-slib += libc.so
else else
install-others += $(libdir)/libc.so \ install-lib += libc.so
$(slibdir)/libc-$(version).so \ install-slib += libc-$(version).so libc.so$(libc.so-version)
$(slibdir)/libc.so$(libc.so-version)
endif endif
endif endif
all: glibc-$(version).$(config).rpm all: glibc-$(version).$(config).rpm
instvars = include lib bin sbin data others instvars = include lib slib bin sbin data others
# Generate the rpm spec file for this configuration. # Generate the rpm spec file for this configuration.
$(config): template $(distinfo) Makefile $(config): template $(distinfo) Makefile

View File

@ -124,8 +124,6 @@ $(inst_includedir)/rpcsvc/bootparam_prot.h: \
# Install the rpc data base file. # Install the rpc data base file.
$(inst_sysconfdir)/rpc: etc.rpc $(inst_sysconfdir)/rpc: etc.rpc
$(do-install) $(do-install)
defines := $(defines) -D_PATH_RPC='"$(sysconfdir)/rpc"'
# Generate the rpcsvc headers with rpcgen. # Generate the rpcsvc headers with rpcgen.
# We use a stamp file to avoid unnessary recompilation each time rpcgen is # We use a stamp file to avoid unnessary recompilation each time rpcgen is

View File

@ -32,7 +32,7 @@
#define NANF \ #define NANF \
(__extension__ \ (__extension__ \
((union { unsigned __l __attribute__((__mode__(__SI__))); flaot __d; }) \ ((union { unsigned __l __attribute__((__mode__(__SI__))); float __d; }) \
{ __l: 0x7fc00000UL }).__d) { __l: 0x7fc00000UL }).__d)
#else #else

View File

@ -247,6 +247,10 @@ sb7 = -2.24409524465858183362e+01; /* 0xC03670E2, 0x42712D62 */
if(hx>=0) return one-r/x; else return r/x-one; if(hx>=0) return one-r/x; else return r/x-one;
} }
weak_alias (__erf, erf) weak_alias (__erf, erf)
#ifdef NO_LONG_DOUBLE
strong_alias (__erf, __erfl)
weak_alias (__erf, erfl)
#endif
#ifdef __STDC__ #ifdef __STDC__
double __erfc(double x) double __erfc(double x)

View File

@ -34,3 +34,7 @@ __fdim (double x, double y)
return x < y ? 0 : x - y; return x < y ? 0 : x - y;
} }
weak_alias (__fdim, fdim) weak_alias (__fdim, fdim)
#ifdef NO_LONG_DOUBLE
strong_alias (__fdim, __fdiml)
weak_alias (__fdim, fdiml)
#endif

View File

@ -27,3 +27,7 @@ __fmax (double x, double y)
return (isgreaterequal (x, y) || isnan (y)) ? x : y; return (isgreaterequal (x, y) || isnan (y)) ? x : y;
} }
weak_alias (__fmax, fmax) weak_alias (__fmax, fmax)
#ifdef NO_LONG_DOUBLE
strong_alias (__fmax, __fmaxl)
weak_alias (__fmax, fmaxl)
#endif

View File

@ -27,3 +27,7 @@ __fmin (double x, double y)
return (islessequal (x, y) || isnan (y)) ? x : y; return (islessequal (x, y) || isnan (y)) ? x : y;
} }
weak_alias (__fmin, fmin) weak_alias (__fmin, fmin)
#ifdef NO_LONG_DOUBLE
strong_alias (__fmim, __fminl)
weak_alias (__fmin, fminl)
#endif

View File

@ -129,3 +129,7 @@ static double zero = 0.0;
} }
weak_alias (__log2, log2) weak_alias (__log2, log2)
#ifdef NO_LONG_DOUBLE
strong_alias (__log2, __log2l)
weak_alias (__log2, log2l)
#endif

View File

@ -28,9 +28,6 @@
double double
__nan (const char *tagp) __nan (const char *tagp)
{ {
static const union ieee754_double nan_value =
{ ieee: { mantissa1: 0, mantissa0: 0x80000, exponent: 0x7ff, negative: 0 } };
if (tagp[0] != '\0') if (tagp[0] != '\0')
{ {
char buf[6 + strlen (tagp)]; char buf[6 + strlen (tagp)];
@ -38,6 +35,10 @@ __nan (const char *tagp)
return strtod (buf, NULL); return strtod (buf, NULL);
} }
return nan_value.d; return NAN;
} }
weak_alias (__nan, nan) weak_alias (__nan, nan)
#ifdef NO_LONG_DOUBLE
strong_alias (__nan, __nanl)
weak_alias (__nan, nanl)
#endif

View File

@ -28,9 +28,6 @@
float float
__nanf (const char *tagp) __nanf (const char *tagp)
{ {
static const union ieee754_float nan_value =
{ ieee: { mantissa: 0x400000, exponent: 0xff, negative: 0 } };
if (tagp[0] != '\0') if (tagp[0] != '\0')
{ {
char buf[6 + strlen (tagp)]; char buf[6 + strlen (tagp)];
@ -38,6 +35,6 @@ __nanf (const char *tagp)
return strtof (buf, NULL); return strtof (buf, NULL);
} }
return nan_value.f; return NANF;
} }
weak_alias (__nanf, nanf) weak_alias (__nanf, nanf)

View File

@ -28,10 +28,6 @@
long double long double
__nanl (const char *tagp) __nanl (const char *tagp)
{ {
static const union ieee854_long_double nan_value =
{ ieee: { mantissa1: 0, mantissa0: 0xc0000000,
exponent: 0x7fff, negative: 0 } };
if (tagp[0] != '\0') if (tagp[0] != '\0')
{ {
char buf[6 + strlen (tagp)]; char buf[6 + strlen (tagp)];
@ -39,6 +35,6 @@ __nanl (const char *tagp)
return strtold (buf, NULL); return strtold (buf, NULL);
} }
return nan_value.d; return NANL;
} }
weak_alias (__nanl, nanl) weak_alias (__nanl, nanl)

View File

@ -110,3 +110,7 @@ __remquo (double x, double y, int *quo)
return x; return x;
} }
weak_alias (__remquo, remquo) weak_alias (__remquo, remquo)
#ifdef NO_LONG_DOUBLE
strong_alias (__remquo, __remquol)
weak_alias (__remquo, remquol)
#endif

View File

@ -414,7 +414,7 @@ __inline_forward(void,sincosl,
#define isgreater(x, y) \ #define isgreater(x, y) \
__extension__ \ __extension__ \
({ char __result; \ ({ char __result; \
__asm__ ("fcmp %2,%1; fsogt %0" \ __asm__ ("fcmp%.x %2,%1; fsogt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \ : "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; }) (int) __result; })
@ -422,7 +422,7 @@ __inline_forward(void,sincosl,
#define isgreaterequal(x, y) \ #define isgreaterequal(x, y) \
__extension__ \ __extension__ \
({ char __result; \ ({ char __result; \
__asm__ ("fcmp %2,%1; fsoge %0" \ __asm__ ("fcmp%.x %2,%1; fsoge %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \ : "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; }) (int) __result; })
@ -430,7 +430,7 @@ __inline_forward(void,sincosl,
#define isless(x, y) \ #define isless(x, y) \
__extension__ \ __extension__ \
({ char __result; \ ({ char __result; \
__asm__ ("fcmp %2,%1; fsolt %0" \ __asm__ ("fcmp%.x %2,%1; fsolt %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \ : "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; }) (int) __result; })
@ -438,7 +438,7 @@ __inline_forward(void,sincosl,
#define islessequal(x, y) \ #define islessequal(x, y) \
__extension__ \ __extension__ \
({ char __result; \ ({ char __result; \
__asm__ ("fcmp %2,%1; fsole %0" \ __asm__ ("fcmp%.x %2,%1; fsole %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \ : "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; }) (int) __result; })
@ -446,7 +446,7 @@ __inline_forward(void,sincosl,
#define islessgreater(x, y) \ #define islessgreater(x, y) \
__extension__ \ __extension__ \
({ char __result; \ ({ char __result; \
__asm__ ("fcmp %2,%1; fsogl %0" \ __asm__ ("fcmp%.x %2,%1; fsogl %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \ : "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; }) (int) __result; })
@ -454,7 +454,7 @@ __inline_forward(void,sincosl,
#define isunordered(x, y) \ #define isunordered(x, y) \
__extension__ \ __extension__ \
({ char __result; \ ({ char __result; \
__asm__ ("fcmp %2,%1; fsun %0" \ __asm__ ("fcmp%.x %2,%1; fsun %0" \
: "=dm" (__result) : "f" (x), "f" (y)); \ : "=dm" (__result) : "f" (x), "f" (y)); \
(int) __result; }) (int) __result; })
#endif #endif

View File

@ -34,9 +34,8 @@ feraiseexcept (int excepts)
if (excepts & FE_INVALID) if (excepts & FE_INVALID)
{ {
/* One example of a invalid operation is 0 * Infinity. */ /* One example of a invalid operation is 0 * Infinity. */
double d = 0.0 * HUGE_VAL; double d = HUGE_VAL;
/* Now force the exception. */ __asm__ __volatile__ ("fmul%.s %#0r0,%0; fnop" : "=f" (d) : "0" (d));
__asm__ __volatile__ ("fnop" : : "f" (d));
} }
/* Next: division by zero. */ /* Next: division by zero. */
@ -49,26 +48,21 @@ feraiseexcept (int excepts)
/* Next: overflow. */ /* Next: overflow. */
if (excepts & FE_OVERFLOW) if (excepts & FE_OVERFLOW)
{ {
long double d = LDBL_MAX * LDBL_MAX; long double d = LDBL_MAX;
/* Now force the exception. */ __asm__ __volatile__ ("fmul%.x %0,%0; fnop" : "=f" (d) : "0" (d));
__asm__ __volatile__ ("fnop" : : "f" (d));
} }
/* Next: underflow. */ /* Next: underflow. */
if (excepts & FE_UNDERFLOW) if (excepts & FE_UNDERFLOW)
{ {
long double d = LDBL_MIN / 16.0; long double d = LDBL_MIN;
/* Now force the exception. */ __asm__ __volatile__ ("fdiv%.s %#0r16,%0; fnop" : "=f" (d) : "0" (d));
__asm__ __volatile__ ("fnop" : : "f" (d));
} }
/* Last: inexact. */ /* Last: inexact. */
if (excepts & FE_INEXACT) if (excepts & FE_INEXACT)
{ {
long double d1, d2 = 1.0; long double d = 1.0;
__asm__ __volatile__ ("fmovecr %#0,%0\n\t" __asm__ __volatile__ ("fdiv%.s %#0r3,%0; fnop" : "=f" (d) : "0" (d));
"fdiv%.x %1,%0\n\t"
"fnop"
: "=&f" (d1) : "f" (d2));
} }
} }

View File

@ -26,15 +26,19 @@
/* IEEE positive infinity (-HUGE_VAL is negative infinity). */ /* IEEE positive infinity (-HUGE_VAL is negative infinity). */
#define __HUGE_VAL_bytes { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 }
#define __huge_val_t union { unsigned char __c[8]; double __d; }
#ifdef __GNUC__ #ifdef __GNUC__
#define HUGE_VAL (__extension__ \
((__huge_val_t) { __c: __HUGE_VAL_bytes }).__d) #define HUGE_VAL \
#else /* Not GCC. */ (__extension__ \
static __huge_val_t __huge_val = { __HUGE_VAL_bytes }; ((union { unsigned long long __l; double __d; }) \
{ __l: 0x7ff0000000000000ULL }).__d)
#else /* not GCC */
static union { unsigned char __c[8]; double __d; } __huge_val =
{ { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
#define HUGE_VAL (__huge_val.__d) #define HUGE_VAL (__huge_val.__d)
#endif /* GCC. */ #endif /* GCC. */
@ -42,27 +46,28 @@ static __huge_val_t __huge_val = { __HUGE_VAL_bytes };
#ifdef __USE_ISOC9X #ifdef __USE_ISOC9X
#define __HUGE_VALF_bytes { 0x7f, 0x80, 0, 0 } #ifdef __GNUC__
#define __huge_valf_t union { unsigned char __c[4]; float __f; } #define HUGE_VALF \
#ifdef __GNUC__ (__extension__ \
#define HUGE_VALF (__extension__ \ ((union { unsigned long __l; float __f; }) \
((__huge_valf_t) { __c: __HUGE_VALF_bytes }).__f) { __l: 0x7f800000UL }).__f)
#else /* Not GCC. */
static __huge_valf_t __huge_valf = { __HUGE_VALF_bytes }; #define HUGE_VALL \
(__extension__ \
((union { unsigned long __l[3]; long double __ld; }) \
{ __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
#else /* not GCC */
static union { unsigned char __c[4]; float __f; } __huge_valf =
{ { 0x7f, 0x80, 0, 0 } };
#define HUGE_VALF (__huge_valf.__f) #define HUGE_VALF (__huge_valf.__f)
#endif /* GCC. */
static union { unsigned char __c[12]; long double __ld; } __huge_vall =
#define __HUGE_VALL_bytes { 0x7f, 0xff, 0x80, 0, 0, 0, 0, 0, 0, 0, 0, 0 } { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
#define __huge_vall_t union { unsigned char __c[12]; long double __ld; }
#ifdef __GNUC__
#define HUGE_VALL (__extension__ \
((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
#else /* Not GCC. */
static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
#define HUGE_VALL (__huge_vall.__ld) #define HUGE_VALL (__huge_vall.__ld)
#endif /* GCC. */ #endif /* GCC. */
#endif /* __USE_ISOC9X. */ #endif /* __USE_ISOC9X. */

59
sysdeps/m68k/nan.h Normal file
View File

@ -0,0 +1,59 @@
/* `NAN' constants for m68k.
Copyright (C) 1997 Free Software Foundation, Inc.
This file is part of the GNU C Library.
The GNU C Library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
The GNU C Library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Library General Public License for more details.
You should have received a copy of the GNU Library General Public
License along with the GNU C Library; see the file COPYING.LIB. If not,
write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */
#ifndef _NAN_H
#define _NAN_H 1
/* IEEE Not A Number. */
#ifdef __GNUC__
#define NAN \
(__extension__ \
((union { unsigned long long __l; double __d; }) \
{ __l: 0x7fffffffffffffffULL }).__d)
#define NANF \
(__extension__ \
((union { unsigned long __l; float __f; }) \
{ __l: 0x7fffffffUL }).__f)
#define NANL \
(__extension__ \
((union { unsigned long __l[3]; long double __ld; }) \
{ __l: { 0x7fff0000UL, 0xffffffffUL, 0xffffffffUL } }).__ld)
#else
static union { unsigned char __c[8]; double __d; } __nan =
{ { 0x7f, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
#define NAN (__nan.__d)
static union { unsigned char __c[4]; float __f; } __nanf =
{ { 0x7f, 0xff, 0xff, 0xff } };
#define NANF (__nanf.__f)
static union { unsigned char __c[12]; long double __ld; } __nanl =
{ { 0x7f, 0xff, 0, 0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
#define NANL (__nanl.__ld)
#endif /* GCC. */
#endif /* nan.h */