1 /****************************************************************
2 Copyright (C) 1998 Lucent Technologies
3 All Rights Reserved
4 
5 Permission to use, copy, modify, and distribute this software and
6 its documentation for any purpose and without fee is hereby
7 granted, provided that the above copyright notice appear in all
8 copies and that both that the copyright notice and this
9 permission notice and warranty disclaimer appear in supporting
10 documentation, and that the name of Lucent or any of its entities
11 not be used in advertising or publicity pertaining to
12 distribution of the software without specific, written prior
13 permission.
14 
15 LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
17 IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22 THIS SOFTWARE.
23 ****************************************************************/
24 
25 #ifdef NO_ERRNO
26 #define errno_set(x) /*nothing*/
27 #define ErrnoChk /* nothing */
28 #else
29 #define errno_set(x) errno = x
30 #define ErrnoChk errno ||
31 #endif
32 
33 #ifdef NANCHECK
34 #ifdef IEEE_MC68k
35 #define errchk(x) ErrnoChk ((((Long *)&(x))[0] & 0x7ff00000L) == 0x7ff00000L)\
36 	&& (((Long *)&(x))[1] || ((Long *)&(x))[0] & 0xfffffL)
37 #else
38 #ifdef IEEE_8087
39 #define errchk(x) ErrnoChk ((((Long *)&(x))[1] & 0x7ff00000L) == 0x7ff00000L)\
40 	&& (((Long *)&(x))[0] || ((Long *)&(x))[1] & 0xfffffL)
41 #else
42 !!!! Cannot use -DNANCHECK on non-IEEE machines
43 #endif
44 #endif
45 #else
46 #define errchk(x) errno
47 #endif
48 
49 #ifdef KR_headers
50 extern char *strerror();
51 #endif
52