Contents in 1999-06-04-13 of release-21-2.
[chise/xemacs-chise.git.1] / src / sysfloat.h
1 /*
2    Copyright (C) 1995 Free Software Foundation, Inc.
3
4 This file is part of XEmacs.
5
6 XEmacs is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by the
8 Free Software Foundation; either version 2, or (at your option) any
9 later version.
10
11 XEmacs is distributed in the hope that it will be useful, but WITHOUT
12 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
14 for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with XEmacs; see the file COPYING.  If not, write to
18 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
19 Boston, MA 02111-1307, USA.  */
20
21 /* Synched up with: Not really in FSF. */
22
23 /* Work around a problem that happens because math.h on hpux 7
24    defines two static variables--which, in Emacs, are not really static,
25    because `static' is defined as nothing.  The problem is that they are
26    defined both in data.c and in floatfns.c.
27    These macros prevent the name conflict.
28
29    (Is it still necessary to define static to nothing on hpux7?
30    Removing that would be the best fix. -jwz)
31   */
32 # if defined (HPUX) && !defined (HPUX8)
33 #  define _MAXLDBL THIS_FILENAME ## _maxldbl
34 #  define _NMAXLDBL THIS_FILENAME ## _nmaxldbl
35 # endif
36
37 #if defined(MSDOS) || (defined(LINUX) && \
38                        !(defined (__GLIBC__) && (__GLIBC__ >= 2)))
39 /* These are redefined (correctly, but differently) in values.h.  */
40 #undef INTBITS
41 #undef LONGBITS
42 #undef SHORTBITS
43 #endif
44
45 #include <math.h>
46
47 #ifdef WINDOWSNT
48 /* A quirky way to obtain logb prototype */
49 #include <float.h>
50 #define logb _logb
51 #endif
52
53 #ifdef HAVE_MATHERR
54 /* Work around symbol conflict on Linux/glibc */
55 #ifndef DOMAIN
56 /* SysV matherr is not defined if _BSD_SOURCE is used, and on Linux X11 */
57 /* is compiled with _BSD_SOURCE which can also change the size of other */
58 /* types.  The configure test for matherr is broken. */
59 /* Bah.  Good riddance to bad rubbish. */
60 #undef HAVE_MATHERR
61 #endif
62 #endif
63
64 #ifdef NO_MATHERR
65 #undef HAVE_MATHERR
66 #endif
67
68 #ifdef HAVE_MATHERR
69 # ifdef FLOAT_CHECK_ERRNO
70 #  undef FLOAT_CHECK_ERRNO
71 # endif
72 # ifdef FLOAT_CHECK_DOMAIN
73 #  undef FLOAT_CHECK_DOMAIN
74 # endif
75 #endif
76
77 #ifndef NO_FLOAT_CHECK_ERRNO
78 #define FLOAT_CHECK_ERRNO
79 #endif
80
81 #ifdef FLOAT_CHECK_ERRNO
82 # include <errno.h>
83 #endif
84
85 #ifndef isnan
86 # define isnan(x) ((x) != (x))
87 #endif
88