XEmacs 21.2.28 "Hermes".
[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 #ifndef INCLUDED_sysfloat_h_
24 #define INCLUDED_sysfloat_h_
25
26 /* Work around a problem that happens because math.h on hpux 7
27    defines two static variables--which, in Emacs, are not really static,
28    because `static' is defined as nothing.  The problem is that they are
29    defined both in data.c and in floatfns.c.
30    These macros prevent the name conflict.
31
32    (Is it still necessary to define static to nothing on hpux7?
33    Removing that would be the best fix. -jwz)
34   */
35 # if defined (HPUX) && !defined (HPUX8)
36 #  define _MAXLDBL THIS_FILENAME ## _maxldbl
37 #  define _NMAXLDBL THIS_FILENAME ## _nmaxldbl
38 # endif
39
40 #if defined(MSDOS) || (defined(LINUX) && \
41                        !(defined (__GLIBC__) && (__GLIBC__ >= 2)))
42 /* These are redefined (correctly, but differently) in values.h.  */
43 #undef INTBITS
44 #undef LONGBITS
45 #undef SHORTBITS
46 #endif
47
48 #include <math.h>
49
50 #ifdef WINDOWSNT
51 /* A quirky way to obtain logb prototype */
52 #include <float.h>
53 #define logb _logb
54 #endif
55
56 #ifdef HAVE_MATHERR
57 /* Work around symbol conflict on Linux/glibc */
58 #ifndef DOMAIN
59 /* SysV matherr is not defined if _BSD_SOURCE is used, and on Linux X11 */
60 /* is compiled with _BSD_SOURCE which can also change the size of other */
61 /* types.  The configure test for matherr is broken. */
62 /* Bah.  Good riddance to bad rubbish. */
63 #undef HAVE_MATHERR
64 #endif
65 #endif
66
67 #ifdef NO_MATHERR
68 #undef HAVE_MATHERR
69 #endif
70
71 #ifdef HAVE_MATHERR
72 # ifdef FLOAT_CHECK_ERRNO
73 #  undef FLOAT_CHECK_ERRNO
74 # endif
75 # ifdef FLOAT_CHECK_DOMAIN
76 #  undef FLOAT_CHECK_DOMAIN
77 # endif
78 #endif
79
80 #ifndef NO_FLOAT_CHECK_ERRNO
81 #define FLOAT_CHECK_ERRNO
82 #endif
83
84 #ifdef FLOAT_CHECK_ERRNO
85 # include <errno.h>
86 #endif
87
88 #ifndef isnan
89 # define isnan(x) ((x) != (x))
90 #endif
91
92 #endif /* INCLUDED_sysfloat_h_ */