View | Details | Raw Unified | Return to bug 50523
Collapse All | Expand All

(-)new/include/limits.h (-1 / +1 lines)
Lines 125-131 Link Here
125
125
126
#define	MB_LEN_MAX		6	/* 31-bit UTF-8 */
126
#define	MB_LEN_MAX		6	/* 31-bit UTF-8 */
127
127
128
#include <machine/limits.h>
128
#include <sys/limits.h>
129
129
130
#if __POSIX_VISIBLE
130
#if __POSIX_VISIBLE
131
#include <sys/syslimits.h>
131
#include <sys/syslimits.h>
(-)new/sys/alpha/include/_limits.h (+87 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *
4
 * Redistribution and use in source and binary forms, with or without
5
 * modification, are permitted provided that the following conditions
6
 * are met:
7
 * 1. Redistributions of source code must retain the above copyright
8
 *    notice, this list of conditions and the following disclaimer.
9
 * 2. Redistributions in binary form must reproduce the above copyright
10
 *    notice, this list of conditions and the following disclaimer in the
11
 *    documentation and/or other materials provided with the distribution.
12
 *
13
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
14
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
17
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
23
 * SUCH DAMAGE.
24
 *
25
 * $FreeBSD$
26
 */
27
28
#ifndef _MACHINE__LIMITS_H_
29
#define	_MACHINE__LIMITS_H_
30
31
#define	__CHAR_BIT	8		/* number of bits in a char */
32
33
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
34
#define	__SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
35
36
#define	__UCHAR_MAX	0xffU		/* max value for an unsigned char */
37
#define	__CHAR_MAX	0x7f		/* max value for a char */
38
#define	__CHAR_MIN	(-0x7f-1)	/* min value for a char */
39
40
#define	__USHRT_MAX	0xffffU		/* max value for an unsigned short */
41
#define	__SHRT_MAX	0x7fff		/* max value for a short */
42
#define	__SHRT_MIN	(-0x7fff-1)	/* min value for a short */
43
44
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
45
#define	__INT_MAX	0x7fffffff	/* max value for an int */
46
#define	__INT_MIN	(-0x7fffffff-1)	/* min value for an int */
47
48
#define	__WCHAR_MIN	__INT_MIN	/* min value for wchar_t */
49
#define	__WCHAR_MAX	__INT_MAX	/* max value for wchar_t */
50
51
#define	__WINT_MIN	__INT_MIN	/* min value for wint_t */
52
#define	__WINT_MAX	__INT_MAX	/* max value for wint_t */
53
54
#define	__ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
55
#define	__LONG_MAX	0x7fffffffffffffffL	/* max for a long */
56
#define	__LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
57
58
/* Long longs and longs are the same size on the alpha. */
59
					/* max for an unsigned long long */
60
#define	__ULLONG_MAX	0xffffffffffffffffULL
61
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
62
#define	__LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
63
64
#define	__SSIZE_MAX	__LONG_MAX	/* max value for a ssize_t */
65
66
#define	__SIZE_T_MAX	__ULONG_MAX	/* max value for a size_t */
67
68
#define	__OFF_MAX	__LONG_MAX	/* max value for a off_t */
69
#define	__OFF_MIN	__LONG_MIN	/* min value for a off_t */
70
71
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
72
#define	__UQUAD_MAX	(__ULONG_MAX)	/* max value for a uquad_t */
73
#define	__QUAD_MAX	(__LONG_MAX)	/* max value for a quad_t */
74
#define	__QUAD_MIN	(__LONG_MIN)	/* min value for a quad_t */
75
76
#define	__LONG_BIT	64
77
#define	__WORD_BIT	32
78
79
#define	__DBL_DIG	15
80
#define	__DBL_MAX	1.7976931348623157E+308
81
#define	__DBL_MIN	2.2250738585072014E-308
82
83
#define	__FLT_DIG	6
84
#define	__FLT_MAX	3.40282347E+38F
85
#define	__FLT_MIN	1.17549435E-38F
86
87
#endif /* !_MACHINE__LIMITS_H_ */
(-)new/sys/alpha/include/limits.h (-65 / +2 lines)
Lines 38-107 Link Here
38
#ifndef	_MACHINE_LIMITS_H_
38
#ifndef	_MACHINE_LIMITS_H_
39
#define	_MACHINE_LIMITS_H_
39
#define	_MACHINE_LIMITS_H_
40
40
41
#define	CHAR_BIT	8		/* number of bits in a char */
41
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
42
42
#include <sys/limits.h>
43
/*
44
 * According to ANSI (section 2.2.4.2), the values below must be usable by
45
 * #if preprocessing directives.  Additionally, the expression must have the
46
 * same type as would an expression that is an object of the corresponding
47
 * type converted according to the integral promotions.  The subtraction for
48
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
49
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
50
 * These numbers are for the default configuration of gcc.  They work for
51
 * some other compilers as well, but this should not be depended on.
52
 */
53
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
54
#define	SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
55
56
#define	UCHAR_MAX	0xffU		/* max value for an unsigned char */
57
#define	CHAR_MAX	0x7f		/* max value for a char */
58
#define	CHAR_MIN	(-0x7f-1)	/* min value for a char */
59
60
#define	USHRT_MAX	0xffffU		/* max value for an unsigned short */
61
#define	SHRT_MAX	0x7fff		/* max value for a short */
62
#define	SHRT_MIN	(-0x7fff-1)	/* min value for a short */
63
64
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
65
#define	INT_MAX		0x7fffffff	/* max value for an int */
66
#define	INT_MIN		(-0x7fffffff-1)	/* min value for an int */
67
68
#define	ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
69
#define	LONG_MAX	0x7fffffffffffffffL	/* max for a long */
70
#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
71
72
/* Long longs and longs are the same size on the alpha. */
73
					/* max for an unsigned long long */
74
#define	ULLONG_MAX	0xffffffffffffffffULL
75
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
76
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
77
78
#if !defined(_ANSI_SOURCE)
79
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
80
81
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
82
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
83
84
#define	OFF_MAX		LONG_MAX	/* max value for a off_t */
85
#define	OFF_MIN		LONG_MIN	/* min value for a off_t */
86
87
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
88
#define	UQUAD_MAX	(ULONG_MAX)	/* max value for a uquad_t */
89
#define	QUAD_MAX	(LONG_MAX)	/* max value for a quad_t */
90
#define	QUAD_MIN	(LONG_MIN)	/* min value for a quad_t */
91
#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
92
#endif /* !_ANSI_SOURCE */
93
94
#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
95
#define	LONG_BIT	64
96
#define	WORD_BIT	32
97
98
#define	DBL_DIG		15
99
#define	DBL_MAX		1.7976931348623157E+308
100
#define	DBL_MIN		2.2250738585072014E-308
101
102
#define	FLT_DIG		6
103
#define	FLT_MAX		3.40282347E+38F
104
#define	FLT_MIN		1.17549435E-38F
105
#endif
106
43
107
#endif /* !_MACHINE_LIMITS_H_ */
44
#endif /* !_MACHINE_LIMITS_H_ */
(-)new/sys/arm/include/_limits.h (+89 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 * $FreeBSD$
27
 */
28
29
#ifndef _MACHINE__LIMITS_H_
30
#define	_MACHINE__LIMITS_H_
31
32
#define	__CHAR_BIT	8		/* number of bits in a char */
33
34
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
35
#define	__SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
36
37
#define	__UCHAR_MAX	0xff		/* max value for an unsigned char */
38
39
#ifdef __CHAR_UNSIGNED__
40
#define	__CHAR_MAX	__UCHAR_MAX	/* max value for a char */
41
#define	__CHAR_MIN	0		/* min value for a char */
42
#else
43
#define	__CHAR_MAX	__SCHAR_MAX	/* max value for a char */
44
#define	__CHAR_MIN	__SCHAR_MIN	/* min value for a char */
45
#endif
46
47
#define	__USHRT_MAX	0xffff		/* max value for an unsigned short */
48
#define	__SHRT_MAX	0x7fff		/* max value for a short */
49
#define	__SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
50
51
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
52
#define	__INT_MAX	0x7fffffff	/* max value for an int */
53
#define	__INT_MIN	(-0x7fffffff - 1)	/* min value for an int */
54
55
#define	__WCHAR_MIN     __INT_MIN       /* min value for wchar_t */
56
#define	__WCHAR_MAX     __INT_MAX       /* max value for wchar_t */
57
58
#define	__WINT_MIN	__INT_MIN	/* min value for wint_t */
59
#define	__WINT_MAX	__INT_MAX	/* max value for wint_t */   
60
61
/* Bad hack for gcc configured to give 64-bit longs. */
62
#ifdef _LARGE_LONG
63
#define	__ULONG_MAX	0xffffffffffffffffUL
64
#define	__LONG_MAX	0x7fffffffffffffffL
65
#define	__LONG_MIN	(-0x7fffffffffffffffL - 1)
66
#else
67
#define	__ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
68
#define	__LONG_MAX	0x7fffffffL	/* max value for a long */
69
#define	__LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
70
#endif
71
72
			/* max value for an unsigned long long */
73
#define	__ULLONG_MAX	0xffffffffffffffffULL
74
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
75
#define	__LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
76
77
#define	__SSIZE_MAX	__INT_MAX		/* max value for a ssize_t */
78
79
#define	__SIZE_T_MAX	__UINT_MAX	/* max value for a size_t */
80
81
#define	__OFF_MAX	__LLONG_MAX	/* max value for a off_t */
82
#define	__OFF_MIN	__LLONG_MIN	/* min value for a off_t */
83
84
/* Quads and long longs are the same size.  Ensure they stay in sync. */
85
#define	__UQUAD_MAX	__ULLONG_MAX	/* max value for a uquad_t */
86
#define	__QUAD_MAX	__LLONG_MAX	/* max value for a quad_t */
87
#define	__QUAD_MIN	__LLONG_MIN	/* min value for a quad_t */
88
89
#endif /* !_MACHINE__LIMITS_H_ */
(-)new/sys/arm/include/limits.h (-65 / +4 lines)
Lines 31-105 Link Here
31
 * SUCH DAMAGE.
31
 * SUCH DAMAGE.
32
 *
32
 *
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
34
 * $FreeBSD: src/sys/arm/include/limits.h,v 1.3 2002/12/22 06:38:44 tjr Exp $
34
 *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
35
 * $FreeBSD: src/sys/alpha/include/limits.h,v 1.10 2002/12/22 06:38:44 tjr Exp $
35
 */
36
 */
36
37
37
#ifndef _MACHINE_LIMITS_H_
38
#ifndef _MACHINE_LIMITS_H_
38
#define	_MACHINE_LIMITS_H_
39
#define	_MACHINE_LIMITS_H_
39
40
40
#define	CHAR_BIT	8		/* number of bits in a char */
41
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
41
42
#include <sys/limits.h>
42
/*
43
 * According to ANSI (section 2.2.4.2), the values below must be usable by
44
 * #if preprocessing directives.  Additionally, the expression must have the
45
 * same type as would an expression that is an object of the corresponding
46
 * type converted according to the integral promotions.  The subtraction for
47
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
48
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
49
 * These numbers are for the default configuration of gcc.  They work for
50
 * some other compilers as well, but this should not be depended on.
51
 */
52
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
53
#define	SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
54
55
#define	UCHAR_MAX	0xff		/* max value for an unsigned char */
56
57
#ifdef __CHAR_UNSIGNED__
58
#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
59
#define	CHAR_MIN	0		/* min value for a char */
60
#else
61
#define	CHAR_MAX	SCHAR_MAX	/* max value for a char */
62
#define	CHAR_MIN	SCHAR_MIN	/* min value for a char */
63
#endif
64
65
#define	USHRT_MAX	0xffff		/* max value for an unsigned short */
66
#define	SHRT_MAX	0x7fff		/* max value for a short */
67
#define	SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
68
69
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
70
#define	INT_MAX		0x7fffffff	/* max value for an int */
71
#define	INT_MIN		(-0x7fffffff - 1)	/* min value for an int */
72
73
/* Bad hack for gcc configured to give 64-bit longs. */
74
#ifdef _LARGE_LONG
75
#define	ULONG_MAX	0xffffffffffffffffUL
76
#define	LONG_MAX	0x7fffffffffffffffL
77
#define	LONG_MIN	(-0x7fffffffffffffffL - 1)
78
#else
79
#define	ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
80
#define	LONG_MAX	0x7fffffffL	/* max value for a long */
81
#define	LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
82
#endif
83
84
			/* max value for an unsigned long long */
85
#define	ULLONG_MAX	0xffffffffffffffffULL
86
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
87
#define	LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
88
89
#if !defined(_ANSI_SOURCE)
90
#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
91
92
#if !defined(_POSIX_SOURCE)
93
#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
94
95
#define	OFF_MAX		LLONG_MAX	/* max value for a off_t */
96
#define	OFF_MIN		LLONG_MIN	/* min value for a off_t */
97
98
/* Quads and long longs are the same size.  Ensure they stay in sync. */
99
#define	UQUAD_MAX	ULLONG_MAX	/* max value for a uquad_t */
100
#define	QUAD_MAX	LLONG_MAX	/* max value for a quad_t */
101
#define	QUAD_MIN	LLONG_MIN	/* min value for a quad_t */
102
#endif /* !_POSIX_SOURCE */
103
#endif /* !_ANSI_SOURCE */
104
43
105
#endif /* !_MACHINE_LIMITS_H_ */
44
#endif /* !_MACHINE_LIMITS_H_ */
(-)new/sys/i386/include/_limits.h (+89 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 * $FreeBSD$
27
 */
28
29
#ifndef _MACHINE__LIMITS_H_
30
#define	_MACHINE__LIMITS_H_
31
32
#define	__CHAR_BIT	8		/* number of bits in a char */
33
34
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
35
#define	__SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
36
37
#define	__UCHAR_MAX	0xff		/* max value for an unsigned char */
38
39
#ifdef __CHAR_UNSIGNED__
40
#define	__CHAR_MAX	__UCHAR_MAX	/* max value for a char */
41
#define	__CHAR_MIN	0		/* min value for a char */
42
#else
43
#define	__CHAR_MAX	__SCHAR_MAX	/* max value for a char */
44
#define	__CHAR_MIN	__SCHAR_MIN	/* min value for a char */
45
#endif
46
47
#define	__USHRT_MAX	0xffff		/* max value for an unsigned short */
48
#define	__SHRT_MAX	0x7fff		/* max value for a short */
49
#define	__SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
50
51
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
52
#define	__INT_MAX	0x7fffffff	/* max value for an int */
53
#define	__INT_MIN	(-0x7fffffff - 1)	/* min value for an int */
54
55
#define	__WCHAR_MIN	__INT_MIN       /* min value for wchar_t */
56
#define	__WCHAR_MAX	__INT_MAX       /* max value for wchar_t */
57
58
#define	__WINT_MIN	__INT_MIN       /* min value for wint_t */
59
#define	__WINT_MAX	__INT_MAX       /* max value for wint_t */   
60
61
/* Bad hack for gcc configured to give 64-bit longs. */
62
#ifdef _LARGE_LONG
63
#define	__ULONG_MAX	0xffffffffffffffffUL
64
#define	__LONG_MAX	0x7fffffffffffffffL
65
#define	__LONG_MIN	(-0x7fffffffffffffffL - 1)
66
#else
67
#define	__ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
68
#define	__LONG_MAX	0x7fffffffL	/* max value for a long */
69
#define	__LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
70
#endif
71
72
			/* max value for an unsigned long long */
73
#define	__ULLONG_MAX	0xffffffffffffffffULL
74
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
75
#define	__LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
76
77
#define	__SSIZE_MAX	__INT_MAX		/* max value for a ssize_t */
78
79
#define	__SIZE_T_MAX	__UINT_MAX	/* max value for a size_t */
80
81
#define	__OFF_MAX	__LLONG_MAX	/* max value for an off_t */
82
#define	__OFF_MIN	__LLONG_MIN	/* min value for an off_t */
83
84
/* Quads and long longs are the same size.  Ensure they stay in sync. */
85
#define	__UQUAD_MAX	ULLONG_MAX	/* max value for a uquad_t */
86
#define	__QUAD_MAX	LLONG_MAX	/* max value for a quad_t */
87
#define	__QUAD_MIN	LLONG_MIN	/* min value for a quad_t */
88
89
#endif /* !_MACHINE__LIMITS_H_ */
(-)new/sys/i386/include/limits.h (-65 / +4 lines)
Lines 31-105 Link Here
31
 * SUCH DAMAGE.
31
 * SUCH DAMAGE.
32
 *
32
 *
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
34
 * $FreeBSD: src/sys/i386/include/limits.h,v 1.22 2003/01/01 18:48:53 schweikh Exp $
34
 *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
35
 * $FreeBSD: src/sys/alpha/include/limits.h,v 1.10 2002/12/22 06:38:44 tjr Exp $
35
 */
36
 */
36
37
37
#ifndef _MACHINE_LIMITS_H_
38
#ifndef _MACHINE_LIMITS_H_
38
#define	_MACHINE_LIMITS_H_
39
#define	_MACHINE_LIMITS_H_
39
40
40
#define	CHAR_BIT	8		/* number of bits in a char */
41
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
41
42
#include <sys/limits.h>
42
/*
43
 * According to ANSI (section 2.2.4.2), the values below must be usable by
44
 * #if preprocessing directives.  Additionally, the expression must have the
45
 * same type as would an expression that is an object of the corresponding
46
 * type converted according to the integral promotions.  The subtraction for
47
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
48
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
49
 * These numbers are for the default configuration of gcc.  They work for
50
 * some other compilers as well, but this should not be depended on.
51
 */
52
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
53
#define	SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
54
55
#define	UCHAR_MAX	0xff		/* max value for an unsigned char */
56
57
#ifdef __CHAR_UNSIGNED__
58
#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
59
#define	CHAR_MIN	0		/* min value for a char */
60
#else
61
#define	CHAR_MAX	SCHAR_MAX	/* max value for a char */
62
#define	CHAR_MIN	SCHAR_MIN	/* min value for a char */
63
#endif
64
65
#define	USHRT_MAX	0xffff		/* max value for an unsigned short */
66
#define	SHRT_MAX	0x7fff		/* max value for a short */
67
#define	SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
68
69
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
70
#define	INT_MAX		0x7fffffff	/* max value for an int */
71
#define	INT_MIN		(-0x7fffffff - 1)	/* min value for an int */
72
73
/* Bad hack for gcc configured to give 64-bit longs. */
74
#ifdef _LARGE_LONG
75
#define	ULONG_MAX	0xffffffffffffffffUL
76
#define	LONG_MAX	0x7fffffffffffffffL
77
#define	LONG_MIN	(-0x7fffffffffffffffL - 1)
78
#else
79
#define	ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
80
#define	LONG_MAX	0x7fffffffL	/* max value for a long */
81
#define	LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
82
#endif
83
84
			/* max value for an unsigned long long */
85
#define	ULLONG_MAX	0xffffffffffffffffULL
86
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
87
#define	LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
88
89
#if !defined(_ANSI_SOURCE)
90
#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
91
92
#if !defined(_POSIX_SOURCE)
93
#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
94
95
#define	OFF_MAX		LLONG_MAX	/* max value for an off_t */
96
#define	OFF_MIN		LLONG_MIN	/* min value for an off_t */
97
98
/* Quads and long longs are the same size.  Ensure they stay in sync. */
99
#define	UQUAD_MAX	ULLONG_MAX	/* max value for a uquad_t */
100
#define	QUAD_MAX	LLONG_MAX	/* max value for a quad_t */
101
#define	QUAD_MIN	LLONG_MIN	/* min value for a quad_t */
102
#endif /* !_POSIX_SOURCE */
103
#endif /* !_ANSI_SOURCE */
104
43
105
#endif /* !_MACHINE_LIMITS_H_ */
44
#endif /* !_MACHINE_LIMITS_H_ */
(-)new/sys/ia64/include/_limits.h (+87 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 * $FreeBSD$
27
 */
28
29
#ifndef _MACHINE__LIMITS_H_
30
#define	_MACHINE__LIMITS_H_
31
32
#define	__CHAR_BIT	8		/* number of bits in a char */
33
34
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
35
#define	__SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
36
37
#define	__UCHAR_MAX	0xffU		/* max value for an unsigned char */
38
#define	__CHAR_MAX	0x7f		/* max value for a char */
39
#define	__CHAR_MIN	(-0x7f-1)	/* min value for a char */
40
41
#define	__USHRT_MAX	0xffffU		/* max value for an unsigned short */
42
#define	__SHRT_MAX	0x7fff		/* max value for a short */
43
#define	__SHRT_MIN	(-0x7fff-1)	/* min value for a short */
44
45
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
46
#define	__INT_MAX	0x7fffffff	/* max value for an int */
47
#define	__INT_MIN	(-0x7fffffff-1)	/* min value for an int */
48
49
#define	__WCHAR_MIN	__INT_MIN	/* min value for wchar_t */
50
#define	__WCHAR_MAX	__INT_MAX	/* max value for wchar_t */
51
 
52
#define	__WINT_MIN      __INT_MIN       /* min value for wint_t */ 
53
#define	__WINT_MAX      __INT_MAX       /* max value for wint_t */
54
55
#define	__ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
56
#define	__LONG_MAX	0x7fffffffffffffffL	/* max for a long */
57
#define	__LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
58
59
/* Long longs and longs are the same size on the IA-64. */
60
					/* max for an unsigned long long */
61
#define	__ULLONG_MAX	0xffffffffffffffffULL
62
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
63
#define	__LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
64
65
#define	__SSIZE_MAX	__LONG_MAX	/* max value for a ssize_t */
66
67
#define	__SIZE_T_MAX	__ULONG_MAX	/* max value for a size_t */
68
69
#define	__OFF_MAX	__LONG_MAX	/* max value for an off_t */
70
#define	__OFF_MIN	__LONG_MIN	/* min value for an off_t */
71
72
/* Quads and longs are the same.  Ensure they stay in sync. */
73
#define	__UQUAD_MAX	(__ULONG_MAX)	/* max value for a uquad_t */
74
#define	__QUAD_MAX	(__LONG_MAX)	/* max value for a quad_t */
75
#define	__QUAD_MIN	(__LONG_MIN)	/* min value for a quad_t */
76
77
#define	__LONG_BIT	64
78
#define	__WORD_BIT	32
79
80
#define	__DBL_DIG	15
81
#define	__DBL_MAX	1.7976931348623157E+308
82
#define	__DBL_MIN	2.2250738585072014E-308
83
84
#define	__FLT_DIG	6
85
#define	__FLT_MAX	3.40282347E+38F
86
#define	__FLT_MIN	1.17549435E-38F
87
#endif
(-)new/sys/ia64/include/limits.h (-66 / +7 lines)
Lines 1-6 Link Here
1
/* $FreeBSD: src/sys/ia64/include/limits.h,v 1.8 2003/01/01 18:48:54 schweikh Exp $ */
2
/* From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp */
3
4
/*
1
/*
5
 * Copyright (c) 1988, 1993
2
 * Copyright (c) 1988, 1993
6
 *	The Regents of the University of California.  All rights reserved.
3
 *	The Regents of the University of California.  All rights reserved.
Lines 34-103 Link Here
34
 * SUCH DAMAGE.
31
 * SUCH DAMAGE.
35
 *
32
 *
36
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
34
 *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
35
 * $FreeBSD: src/sys/alpha/include/limits.h,v 1.10 2002/12/22 06:38:44 tjr Exp $
37
 */
36
 */
38
37
39
#define	CHAR_BIT	8		/* number of bits in a char */
38
#ifndef	_MACHINE_LIMITS_H_
40
39
#define	_MACHINE_LIMITS_H_
41
/*
42
 * According to ANSI (section 2.2.4.2), the values below must be usable by
43
 * #if preprocessing directives.  Additionally, the expression must have the
44
 * same type as would an expression that is an object of the corresponding
45
 * type converted according to the integral promotions.  The subtraction for
46
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
47
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
48
 * These numbers are for the default configuration of gcc.  They work for
49
 * some other compilers as well, but this should not be depended on.
50
 */
51
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
52
#define	SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
53
54
#define	UCHAR_MAX	0xffU		/* max value for an unsigned char */
55
#define	CHAR_MAX	0x7f		/* max value for a char */
56
#define	CHAR_MIN	(-0x7f-1)	/* min value for a char */
57
58
#define	USHRT_MAX	0xffffU		/* max value for an unsigned short */
59
#define	SHRT_MAX	0x7fff		/* max value for a short */
60
#define	SHRT_MIN	(-0x7fff-1)	/* min value for a short */
61
62
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
63
#define	INT_MAX		0x7fffffff	/* max value for an int */
64
#define	INT_MIN		(-0x7fffffff-1)	/* min value for an int */
65
66
#define	ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
67
#define	LONG_MAX	0x7fffffffffffffffL	/* max for a long */
68
#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
69
70
/* Long longs and longs are the same size on the IA-64. */
71
					/* max for an unsigned long long */
72
#define	ULLONG_MAX	0xffffffffffffffffULL
73
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
74
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
75
76
#if !defined(_ANSI_SOURCE)
77
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
78
79
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
80
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
81
82
#define	OFF_MAX		LONG_MAX	/* max value for an off_t */
83
#define	OFF_MIN		LONG_MIN	/* min value for an off_t */
84
85
/* Quads and longs are the same.  Ensure they stay in sync. */
86
#define	UQUAD_MAX	(ULONG_MAX)	/* max value for a uquad_t */
87
#define	QUAD_MAX	(LONG_MAX)	/* max value for a quad_t */
88
#define	QUAD_MIN	(LONG_MIN)	/* min value for a quad_t */
89
#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
90
#endif /* !_ANSI_SOURCE */
91
92
#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
93
#define	LONG_BIT	64
94
#define	WORD_BIT	32
95
40
96
#define	DBL_DIG		15
41
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
97
#define	DBL_MAX		1.7976931348623157E+308
42
#include <sys/limits.h>
98
#define	DBL_MIN		2.2250738585072014E-308
99
43
100
#define	FLT_DIG		6
44
#endif /* !_MACHINE_LIMITS_H_ */
101
#define	FLT_MAX		3.40282347E+38F
102
#define	FLT_MIN		1.17549435E-38F
103
#endif
(-)new/sys/powerpc/include/_limits.h (+88 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 * $FreeBSD$
27
 */
28
29
#ifndef _MACHINE__LIMITS_H_
30
#define	_MACHINE__LIMITS_H_
31
32
#define	__CHAR_BIT	8		/* number of bits in a char */
33
34
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
35
#define	__SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
36
37
#define	__UCHAR_MAX	0xff		/* max value for an unsigned char */
38
39
#ifdef __CHAR_UNSIGNED__
40
#define	__CHAR_MAX	__UCHAR_MAX	/* max value for a char */
41
#define	__CHAR_MIN	0		/* min value for a char */
42
#else
43
#define	__CHAR_MAX	__SCHAR_MAX	/* max value for a char */
44
#define	__CHAR_MIN	__SCHAR_MIN	/* min value for a char */
45
#endif
46
47
#define	__USHRT_MAX	0xffff		/* max value for an unsigned short */
48
#define	__SHRT_MAX	0x7fff		/* max value for a short */
49
#define	__SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
50
51
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
52
#define	__INT_MAX	0x7fffffff	/* max value for an int */
53
#define	__INT_MIN	(-0x7fffffff - 1)	/* min value for an int */
54
55
#define	__WCHAR_MIN	__INT_MIN	/* min value for wchar_t */
56
#define	__WCHAR_MAX	__INT_MAX	/* max value for wchar_t */
57
58
#define	__WINT_MIN	__INT_MIN	/* min value for wint_t */
59
#define	__WINT_MAX	__INT_MAX	/* max value for wint_t */ 
60
61
/* Bad hack for gcc configured to give 64-bit longs. */
62
#ifdef _LARGE_LONG
63
#define	__ULONG_MAX	0xffffffffffffffffUL
64
#define	__LONG_MAX	0x7fffffffffffffffL
65
#define	__LONG_MIN	(-0x7fffffffffffffffL - 1)
66
#else
67
#define	__ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
68
#define	__LONG_MAX	0x7fffffffL	/* max value for a long */
69
#define	__LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
70
#endif
71
72
			/* max value for an unsigned long long */
73
#define	__ULLONG_MAX	0xffffffffffffffffULL
74
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
75
#define	__LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
76
#define	__SSIZE_MAX	__INT_MAX		/* max value for a ssize_t */
77
#define	__SIZE_T_MAX	__UINT_MAX	/* max value for a size_t */
78
#define	__OFF_MAX	__LLONG_MAX	/* max value for an off_t */
79
#define	__OFF_MIN	__LLONG_MIN	/* min value for an off_t */
80
81
/* Quads and long longs are the same size.  Ensure they stay in sync. */
82
#define	__UQUAD_MAX	__ULLONG_MAX	/* max value for a uquad_t */
83
#define	__QUAD_MAX	__LLONG_MAX	/* max value for a quad_t */
84
#define	__QUAD_MIN	__LLONG_MIN	/* min value for a quad_t */
85
86
#define	__LONG_BIT	32
87
88
#endif /* !_MACHINE__LIMITS_H_ */
(-)new/sys/powerpc/include/limits.h (-68 / +4 lines)
Lines 31-108 Link Here
31
 * SUCH DAMAGE.
31
 * SUCH DAMAGE.
32
 *
32
 *
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
34
 * $FreeBSD: src/sys/powerpc/include/limits.h,v 1.23 2003/01/18 11:23:42 grehan Exp $
34
 *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
35
 * $FreeBSD$
35
 */
36
 */
36
37
37
#ifndef _MACHINE_LIMITS_H_
38
#ifndef _MACHINE_LIMITS_H_
38
#define	_MACHINE_LIMITS_H_
39
#define	_MACHINE_LIMITS_H_
39
40
40
#define	CHAR_BIT	8		/* number of bits in a char */
41
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
41
42
#include <sys/limits.h>
42
/*
43
 * According to ANSI (section 2.2.4.2), the values below must be usable by
44
 * #if preprocessing directives.  Additionally, the expression must have the
45
 * same type as would an expression that is an object of the corresponding
46
 * type converted according to the integral promotions.  The subtraction for
47
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
48
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
49
 * These numbers are for the default configuration of gcc.  They work for
50
 * some other compilers as well, but this should not be depended on.
51
 */
52
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
53
#define	SCHAR_MIN	(-0x7f - 1)	/* min value for a signed char */
54
55
#define	UCHAR_MAX	0xff		/* max value for an unsigned char */
56
57
#ifdef __CHAR_UNSIGNED__
58
#define	CHAR_MAX	UCHAR_MAX	/* max value for a char */
59
#define	CHAR_MIN	0		/* min value for a char */
60
#else
61
#define	CHAR_MAX	SCHAR_MAX	/* max value for a char */
62
#define	CHAR_MIN	SCHAR_MIN	/* min value for a char */
63
#endif
64
65
#define	USHRT_MAX	0xffff		/* max value for an unsigned short */
66
#define	SHRT_MAX	0x7fff		/* max value for a short */
67
#define	SHRT_MIN	(-0x7fff - 1)	/* min value for a short */
68
69
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
70
#define	INT_MAX		0x7fffffff	/* max value for an int */
71
#define	INT_MIN		(-0x7fffffff - 1)	/* min value for an int */
72
73
/* Bad hack for gcc configured to give 64-bit longs. */
74
#ifdef _LARGE_LONG
75
#define	ULONG_MAX	0xffffffffffffffffUL
76
#define	LONG_MAX	0x7fffffffffffffffL
77
#define	LONG_MIN	(-0x7fffffffffffffffL - 1)
78
#else
79
#define	ULONG_MAX	0xffffffffUL	/* max value for an unsigned long */
80
#define	LONG_MAX	0x7fffffffL	/* max value for a long */
81
#define	LONG_MIN	(-0x7fffffffL - 1)	/* min value for a long */
82
#endif
83
84
			/* max value for an unsigned long long */
85
#define	ULLONG_MAX	0xffffffffffffffffULL
86
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max value for a long long */
87
#define	LLONG_MIN	(-0x7fffffffffffffffLL - 1)  /* min for a long long */
88
89
#if !defined(_ANSI_SOURCE)
90
#define	SSIZE_MAX	INT_MAX		/* max value for a ssize_t */
91
92
#if !defined(_POSIX_SOURCE)
93
#define	SIZE_T_MAX	UINT_MAX	/* max value for a size_t */
94
95
#define	OFF_MAX		LLONG_MAX	/* max value for an off_t */
96
#define	OFF_MIN		LLONG_MIN	/* min value for an off_t */
97
98
/* Quads and long longs are the same size.  Ensure they stay in sync. */
99
#define	UQUAD_MAX	ULLONG_MAX	/* max value for a uquad_t */
100
#define	QUAD_MAX	LLONG_MAX	/* max value for a quad_t */
101
#define	QUAD_MIN	LLONG_MIN	/* min value for a quad_t */
102
103
#define LONG_BIT	32
104
105
#endif /* !_POSIX_SOURCE */
106
#endif /* !_ANSI_SOURCE */
107
43
108
#endif /* !_MACHINE_LIMITS_H_ */
44
#endif /* !_MACHINE_LIMITS_H_ */
(-)new/sys/sparc64/include/_limits.h (+89 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 * $FreeBSD$
27
 */
28
29
#ifndef _MACHINE__LIMITS_H_
30
#define	_MACHINE__LIMITS_H_
31
32
#define	__CHAR_BIT	8		/* number of bits in a char */
33
34
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
35
#define	__SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
36
37
#define	__UCHAR_MAX	0xffU		/* max value for an unsigned char */
38
#define	__CHAR_MAX	0x7f		/* max value for a char */
39
#define	__CHAR_MIN	(-0x7f-1)	/* min value for a char */
40
41
#define	__USHRT_MAX	0xffffU		/* max value for an unsigned short */
42
#define	__SHRT_MAX	0x7fff		/* max value for a short */
43
#define	__SHRT_MIN	(-0x7fff-1)	/* min value for a short */
44
45
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
46
#define	__INT_MAX	0x7fffffff	/* max value for an int */
47
#define	__INT_MIN	(-0x7fffffff-1)	/* min value for an int */
48
49
#define	__WCHAR_MIN	__INT_MIN	/* min value for wchar_t */
50
#define	__WCHAR_MAX	__INT_MAX	/* max value for wchar_t */
51
52
#define	__WINT_MIN	__INT_MIN	/* min value for wint_t */
53
#define	__WINT_MAX	__INT_MAX	/* max value for wint_t */ 
54
55
#define	__ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
56
#define	__LONG_MAX	0x7fffffffffffffffL	/* max for a long */
57
#define	__LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
58
59
/* Long longs and longs are the same size on the alpha. */
60
					/* max for an unsigned long long */
61
#define	__ULLONG_MAX	0xffffffffffffffffULL
62
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
63
#define	__LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
64
65
#define	__SSIZE_MAX	__LONG_MAX	/* max value for a ssize_t */
66
67
#define	__SIZE_T_MAX	__ULONG_MAX	/* max value for a size_t */
68
69
#define	__OFF_MAX	__LONG_MAX	/* max value for an off_t */
70
#define	__OFF_MIN	__LONG_MIN	/* min value for an off_t */
71
72
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
73
#define	__UQUAD_MAX	(__ULONG_MAX)	/* max value for a uquad_t */
74
#define	__QUAD_MAX	(__LONG_MAX)	/* max value for a quad_t */
75
#define	__QUAD_MIN	(__LONG_MIN)	/* min value for a quad_t */
76
77
78
#define	__LONG_BIT	64
79
#define	__WORD_BIT	32
80
81
#define	__DBL_DIG	15
82
#define	__DBL_MAX	1.7976931348623157E+308
83
#define	__DBL_MIN	2.2250738585072014E-308
84
85
#define	__FLT_DIG	6
86
#define	__FLT_MAX	3.40282347E+38F
87
#define	__FLT_MIN	1.17549435E-38F
88
89
#endif /* !_MACHINE__LIMITS_H_ */
(-)new/sys/sparc64/include/limits.h (-66 / +11 lines)
Lines 10-15 Link Here
10
 * 2. Redistributions in binary form must reproduce the above copyright
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
12
 *    documentation and/or other materials provided with the distribution.
13
 * 3. All advertising materials mentioning features or use of this software
14
 *    must display the following acknowledgement:
15
 *	This product includes software developed by the University of
16
 *	California, Berkeley and its contributors.
17
 * 4. Neither the name of the University nor the names of its contributors
18
 *    may be used to endorse or promote products derived from this software
19
 *    without specific prior written permission.
13
 *
20
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
21
 * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Lines 24-99 Link Here
24
 * SUCH DAMAGE.
31
 * SUCH DAMAGE.
25
 *
32
 *
26
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
33
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
27
 * $FreeBSD: src/sys/sparc64/include/limits.h,v 1.8 2003/01/01 18:48:58 schweikh Exp $
34
 *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
35
 * $FreeBSD: src/sys/alpha/include/limits.h,v 1.10 2002/12/22 06:38:44 tjr Exp $
28
 */
36
 */
29
37
30
#ifndef	_MACHINE_LIMITS_H_
38
#ifndef	_MACHINE_LIMITS_H_
31
#define	_MACHINE_LIMITS_H_
39
#define	_MACHINE_LIMITS_H_
32
40
33
#define	CHAR_BIT	8		/* number of bits in a char */
41
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
34
42
#include <sys/limits.h>
35
/*
36
 * According to ANSI (section 2.2.4.2), the values below must be usable by
37
 * #if preprocessing directives.  Additionally, the expression must have the
38
 * same type as would an expression that is an object of the corresponding
39
 * type converted according to the integral promotions.  The subtraction for
40
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
41
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
42
 * These numbers are for the default configuration of gcc.  They work for
43
 * some other compilers as well, but this should not be depended on.
44
 */
45
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
46
#define	SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
47
48
#define	UCHAR_MAX	0xffU		/* max value for an unsigned char */
49
#define	CHAR_MAX	0x7f		/* max value for a char */
50
#define	CHAR_MIN	(-0x7f-1)	/* min value for a char */
51
52
#define	USHRT_MAX	0xffffU		/* max value for an unsigned short */
53
#define	SHRT_MAX	0x7fff		/* max value for a short */
54
#define	SHRT_MIN	(-0x7fff-1)	/* min value for a short */
55
56
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
57
#define	INT_MAX		0x7fffffff	/* max value for an int */
58
#define	INT_MIN		(-0x7fffffff-1)	/* min value for an int */
59
60
#define	ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
61
#define	LONG_MAX	0x7fffffffffffffffL	/* max for a long */
62
#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
63
64
/* Long longs and longs are the same size on the alpha. */
65
					/* max for an unsigned long long */
66
#define	ULLONG_MAX	0xffffffffffffffffULL
67
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
68
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
69
70
#if !defined(_ANSI_SOURCE)
71
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
72
73
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
74
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
75
76
#define	OFF_MAX		LONG_MAX	/* max value for an off_t */
77
#define	OFF_MIN		LONG_MIN	/* min value for an off_t */
78
79
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
80
#define	UQUAD_MAX	(ULONG_MAX)	/* max value for a uquad_t */
81
#define	QUAD_MAX	(LONG_MAX)	/* max value for a quad_t */
82
#define	QUAD_MIN	(LONG_MIN)	/* min value for a quad_t */
83
#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
84
#endif /* !_ANSI_SOURCE */
85
86
#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
87
#define	LONG_BIT	64
88
#define	WORD_BIT	32
89
90
#define	DBL_DIG		15
91
#define	DBL_MAX		1.7976931348623157E+308
92
#define	DBL_MIN		2.2250738585072014E-308
93
94
#define	FLT_DIG		6
95
#define	FLT_MAX		3.40282347E+38F
96
#define	FLT_MIN		1.17549435E-38F
97
#endif
98
43
99
#endif /* !_MACHINE_LIMITS_H_ */
44
#endif /* !_MACHINE_LIMITS_H_ */
(-)new/sys/sys/limits.h (+100 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003 
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 * $FreeBSD$
27
 */
28
29
#ifndef	_SYS_LIMITS_H_
30
#define	_SYS_LIMITS_H_
31
32
#include <machine/_limits.h>
33
34
#define	CHAR_BIT	__CHAR_BIT		/* number of bits in a char */
35
36
/*
37
 * According to ANSI (section 2.2.4.2), the values below must be usable by
38
 * #if preprocessing directives.  Additionally, the expression must have the
39
 * same type as would an expression that is an object of the corresponding
40
 * type converted according to the integral promotions.  The subtraction for
41
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
42
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
43
 * These numbers are for the default configuration of gcc.  They work for
44
 * some other compilers as well, but this should not be depended on.
45
 */
46
#define	SCHAR_MAX	__SCHAR_MAX		/* max value for a signed char */
47
#define	SCHAR_MIN	(__SCHAR_MIN)	/* min value for a signed char */
48
49
#define	UCHAR_MAX	(__UCHAR_MAX)		/* max value for an unsigned char */
50
#define	CHAR_MAX	(__CHAR_MAX)		/* max value for a char */
51
#define	CHAR_MIN	(__CHAR_MIN)	/* min value for a char */
52
53
#define	USHRT_MAX	__USHRT_MAX		/* max value for an unsigned short */
54
#define	SHRT_MAX	__SHRT_MAX		/* max value for a short */
55
#define	SHRT_MIN	__SHRT_MIN	/* min value for a short */
56
57
#define	UINT_MAX	__UNIT_MAX	/* max value for an unsigned int */
58
#define	INT_MAX		__INT_MAX	/* max value for an int */
59
#define	INT_MIN		__INT_MIN	/* min value for an int */
60
61
#define	ULONG_MAX	__ULONG_MAX	/* max for an unsigned long */
62
#define	LONG_MAX	__LONG_MAX	/* max for a long */
63
#define	LONG_MIN	(__LONG_MIN) /* min for a long */
64
65
/* Long longs and longs are the same size on the alpha. */
66
					/* max for an unsigned long long */
67
#define	ULLONG_MAX	__ULLONG_MAX
68
#define	LLONG_MAX	__LLONG_MAX	/* max for a long long */
69
#define	LLONG_MIN	__LLONG_MIN /* min for a long long */
70
71
#if !defined(_ANSI_SOURCE)
72
#define	SSIZE_MAX	__SSIZE_MAX	/* max value for a ssize_t */
73
74
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
75
#define	SIZE_T_MAX	__SIZE_T_MAX	/* max value for a size_t */
76
77
#define	OFF_MAX		__OFF_MAX	/* max value for a off_t */
78
#define	OFF_MIN		__OFF_MIN	/* min value for a off_t */
79
80
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
81
#define	UQUAD_MAX	(__UQUAD_MAX)	/* max value for a uquad_t */
82
#define	QUAD_MAX	(__QUAD_MAX)	/* max value for a quad_t */
83
#define	QUAD_MIN	(__QUAD_MIN)	/* min value for a quad_t */
84
#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
85
#endif /* !_ANSI_SOURCE */
86
87
#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
88
#define	LONG_BIT	__LONG_BIT
89
#define	WORD_BIT	__WORD_BIT
90
91
#define	DBL_DIG		__DBL_DIG
92
#define	DBL_MAX		__DBL_MAX
93
#define	DBL_MIN		__DBL_MIN
94
95
#define	FLT_DIG		__FLT_DIG
96
#define	FLT_MAX		__FLT_MAX
97
#define	FLT_MIN		__FLT_MIN
98
#endif
99
100
#endif /* !_SYS_LIMITS_H_ */
(-)new/sys/x86_64/include/_limits.h (+91 lines)
Line 0 Link Here
1
/*
2
 * Copyright (c) 2003
3
 *	All rights reserved.
4
 *
5
 * Redistribution and use in source and binary forms, with or without
6
 * modification, are permitted provided that the following conditions
7
 * are met:
8
 * 1. Redistributions of source code must retain the above copyright
9
 *    notice, this list of conditions and the following disclaimer.
10
 * 2. Redistributions in binary form must reproduce the above copyright
11
 *    notice, this list of conditions and the following disclaimer in the
12
 *    documentation and/or other materials provided with the distribution.
13
 *
14
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND
15
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
18
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24
 * SUCH DAMAGE.
25
 *
26
 *	@(#)limits.h	8.3 (Berkeley) 1/4/94
27
 *	From: NetBSD: limits.h,v 1.3 1997/04/06 08:47:31 cgd Exp
28
 * 	From: FreeBSD: src/sys/alpha/include/limits.h,v 1.8 2001/11/02
29
 * $FreeBSD$
30
 */
31
32
#ifndef _MACHINE__LIMITS_H_
33
#define	_MACHINE__LIMITS_H_
34
35
#define	__CHAR_BIT	8		/* number of bits in a char */
36
37
#define	__SCHAR_MAX	0x7f		/* max value for a signed char */
38
#define	__SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
39
40
#define	__UCHAR_MAX	0xffU		/* max value for an unsigned char */
41
#define	__CHAR_MAX	0x7f		/* max value for a char */
42
#define	__CHAR_MIN	(-0x7f-1)	/* min value for a char */
43
44
#define	__USHRT_MAX	0xffffU		/* max value for an unsigned short */
45
#define	__SHRT_MAX	0x7fff		/* max value for a short */
46
#define	__SHRT_MIN	(-0x7fff-1)	/* min value for a short */
47
48
#define	__UINT_MAX	0xffffffffU	/* max value for an unsigned int */
49
#define	__INT_MAX	0x7fffffff	/* max value for an int */
50
#define	__INT_MIN	(-0x7fffffff-1)	/* min value for an int */
51
52
#define	__WCHAR_MIN	__INT_MIN	/* min value for wchar_t */
53
#define	__WCHAR_MAX	__INT_MAX	/* max value for wchar_t */
54
55
#define	__WINT_MIN	__INT_MIN	/* min value for wint_t */
56
#define	__WINT_MAX	__INT_MAX	/* max value for wint_t */ 
57
58
#define	__ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
59
#define	__LONG_MAX	0x7fffffffffffffffL	/* max for a long */
60
#define	__LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
61
62
/* Long longs and longs are the same size on the alpha. */
63
					/* max for an unsigned long long */
64
#define	__ULLONG_MAX	0xffffffffffffffffULL
65
#define	__LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
66
#define	__LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
67
68
#define	__SSIZE_MAX	__LONG_MAX	/* max value for a ssize_t */
69
70
#define	__SIZE_T_MAX	__ULONG_MAX	/* max value for a size_t */
71
72
#define	__OFF_MAX	__LONG_MAX	/* max value for an off_t */
73
#define	__OFF_MIN	__LONG_MIN	/* min value for an off_t */
74
75
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
76
#define	__UQUAD_MAX	(__ULONG_MAX)	/* max value for a uquad_t */
77
#define	__QUAD_MAX	(__LONG_MAX)	/* max value for a quad_t */
78
#define	__QUAD_MIN	(__LONG_MIN)	/* min value for a quad_t */
79
80
#define	__LONG_BIT	64
81
#define	__WORD_BIT	32
82
83
#define	__DBL_DIG	15
84
#define	__DBL_MAX	1.7976931348623157E+308
85
#define	__DBL_MIN	2.2250738585072014E-308
86
87
#define	__FLT_DIG	6
88
#define	__FLT_MAX	3.40282347E+38F
89
#define	__FLT_MIN	1.17549435E-38F
90
91
#endif /* !_MACHINE__LIMITS_H_ */
(-)new/sys/x86_64/include/limits.h (-65 / +2 lines)
Lines 39-108 Link Here
39
#ifndef	_MACHINE_LIMITS_H_
39
#ifndef	_MACHINE_LIMITS_H_
40
#define	_MACHINE_LIMITS_H_
40
#define	_MACHINE_LIMITS_H_
41
41
42
#define	CHAR_BIT	8		/* number of bits in a char */
42
#warning "<machine/limits.h> is deprecated.  Include <sys/limits.h> instead."
43
43
#include <sys/limits.h>
44
/*
45
 * According to ANSI (section 2.2.4.2), the values below must be usable by
46
 * #if preprocessing directives.  Additionally, the expression must have the
47
 * same type as would an expression that is an object of the corresponding
48
 * type converted according to the integral promotions.  The subtraction for
49
 * INT_MIN, etc., is so the value is not unsigned; e.g., 0x80000000 is an
50
 * unsigned int for 32-bit two's complement ANSI compilers (section 3.1.3.2).
51
 * These numbers are for the default configuration of gcc.  They work for
52
 * some other compilers as well, but this should not be depended on.
53
 */
54
#define	SCHAR_MAX	0x7f		/* max value for a signed char */
55
#define	SCHAR_MIN	(-0x7f-1)	/* min value for a signed char */
56
57
#define	UCHAR_MAX	0xffU		/* max value for an unsigned char */
58
#define	CHAR_MAX	0x7f		/* max value for a char */
59
#define	CHAR_MIN	(-0x7f-1)	/* min value for a char */
60
61
#define	USHRT_MAX	0xffffU		/* max value for an unsigned short */
62
#define	SHRT_MAX	0x7fff		/* max value for a short */
63
#define	SHRT_MIN	(-0x7fff-1)	/* min value for a short */
64
65
#define	UINT_MAX	0xffffffffU	/* max value for an unsigned int */
66
#define	INT_MAX		0x7fffffff	/* max value for an int */
67
#define	INT_MIN		(-0x7fffffff-1)	/* min value for an int */
68
69
#define	ULONG_MAX	0xffffffffffffffffUL	/* max for an unsigned long */
70
#define	LONG_MAX	0x7fffffffffffffffL	/* max for a long */
71
#define	LONG_MIN	(-0x7fffffffffffffffL-1) /* min for a long */
72
73
/* Long longs and longs are the same size on the alpha. */
74
					/* max for an unsigned long long */
75
#define	ULLONG_MAX	0xffffffffffffffffULL
76
#define	LLONG_MAX	0x7fffffffffffffffLL	/* max for a long long */
77
#define	LLONG_MIN	(-0x7fffffffffffffffLL-1) /* min for a long long */
78
79
#if !defined(_ANSI_SOURCE)
80
#define	SSIZE_MAX	LONG_MAX	/* max value for a ssize_t */
81
82
#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE)
83
#define	SIZE_T_MAX	ULONG_MAX	/* max value for a size_t */
84
85
#define	OFF_MAX		LONG_MAX	/* max value for an off_t */
86
#define	OFF_MIN		LONG_MIN	/* min value for an off_t */
87
88
/* Quads and longs are the same on the alpha.  Ensure they stay in sync. */
89
#define	UQUAD_MAX	(ULONG_MAX)	/* max value for a uquad_t */
90
#define	QUAD_MAX	(LONG_MAX)	/* max value for a quad_t */
91
#define	QUAD_MIN	(LONG_MIN)	/* min value for a quad_t */
92
#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */
93
#endif /* !_ANSI_SOURCE */
94
95
#if (!defined(_ANSI_SOURCE)&&!defined(_POSIX_SOURCE)) || defined(_XOPEN_SOURCE)
96
#define	LONG_BIT	64
97
#define	WORD_BIT	32
98
99
#define	DBL_DIG		15
100
#define	DBL_MAX		1.7976931348623157E+308
101
#define	DBL_MIN		2.2250738585072014E-308
102
103
#define	FLT_DIG		6
104
#define	FLT_MAX		3.40282347E+38F
105
#define	FLT_MIN		1.17549435E-38F
106
#endif
107
44
108
#endif /* !_MACHINE_LIMITS_H_ */
45
#endif /* !_MACHINE_LIMITS_H_ */

Return to bug 50523