annotate src/sysfloat.h @ 26:441bb1e64a06 r19-15b96

Import from CVS: tag r19-15b96
author cvs
date Mon, 13 Aug 2007 08:51:32 +0200
parents 376386a54a3c
children ec9a17fef872
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
1 /*
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
2 Copyright (C) 1995 Free Software Foundation, Inc.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
3
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
4 This file is part of XEmacs.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
5
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
6 XEmacs is free software; you can redistribute it and/or modify it
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
7 under the terms of the GNU General Public License as published by the
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
8 Free Software Foundation; either version 2, or (at your option) any
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
9 later version.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
10
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
13 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
14 for more details.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
15
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
16 You should have received a copy of the GNU General Public License
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
17 along with XEmacs; see the file COPYING. If not, write to
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
19 Boston, MA 02111-1307, USA. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
20
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
21 /* Synched up with: Not really in FSF. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
22
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
23 /* Work around a problem that happens because math.h on hpux 7
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
24 defines two static variables--which, in Emacs, are not really static,
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
25 because `static' is defined as nothing. The problem is that they are
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
26 defined both in data.c and in floatfns.c.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
27 These macros prevent the name conflict.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
28
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
29 (Is it still necessary to define static to nothing on hpux7?
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
30 Removing that would be the best fix. -jwz)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
31 */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
32 # if defined (HPUX) && !defined (HPUX8)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
33 # define _MAXLDBL THIS_FILENAME ## _maxldbl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
34 # define _NMAXLDBL THIS_FILENAME ## _nmaxldbl
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
35 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
36
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
37 #ifdef MSDOS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
38 /* These are redefined (correctly, but differently) in values.h. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
39 #undef INTBITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
40 #undef LONGBITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
41 #undef SHORTBITS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
42 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
43
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
44 #include <math.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
45
26
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
46 #ifdef HAVE_MATHERR
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
47 /* Work around symbol conflict on Linux/glibc */
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
48 #ifndef DOMAIN
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
49 /* SysV matherr is not defined if _BSD_SOURCE is used, and on Linux X11 */
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
50 /* is compiled with _BSD_SOURCE which can also change the size of other */
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
51 /* types. The configure test for matherr is broken. */
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
52 /* Bah. Good riddance to bad rubbish. */
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
53 #undef HAVE_MATHERR
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
54 #endif
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
55 #endif
441bb1e64a06 Import from CVS: tag r19-15b96
cvs
parents: 0
diff changeset
56
0
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
57 #ifdef NO_MATHERR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
58 #undef HAVE_MATHERR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
59 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
60
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
61 #ifdef HAVE_MATHERR
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
62 # ifdef FLOAT_CHECK_ERRNO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
63 # undef FLOAT_CHECK_ERRNO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
64 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
65 # ifdef FLOAT_CHECK_DOMAIN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
66 # undef FLOAT_CHECK_DOMAIN
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
67 # endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
68 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
69
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
70 #ifndef NO_FLOAT_CHECK_ERRNO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
71 #define FLOAT_CHECK_ERRNO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
72 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
73
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
74 #ifdef FLOAT_CHECK_ERRNO
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
75 # include <errno.h>
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
76 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
77
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
78 /* Avoid traps on VMS from sinh and cosh.
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
79 All the other functions set errno instead. */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
80
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
81 #ifdef VMS
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
82 #undef cosh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
83 #undef sinh
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
84 #define cosh(x) ((exp(x)+exp(-x))*0.5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
85 #define sinh(x) ((exp(x)-exp(-x))*0.5)
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
86 #endif /* VMS */
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
87
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
88 #ifndef isnan
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
89 # define isnan(x) ((x) != (x))
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
90 #endif
376386a54a3c Import from CVS: tag r19-14
cvs
parents:
diff changeset
91