diff options
author | Alexander Kabaev <kan@FreeBSD.org> | 2003-05-19 20:29:07 +0000 |
---|---|---|
committer | Alexander Kabaev <kan@FreeBSD.org> | 2003-05-19 20:29:07 +0000 |
commit | 980ded9a7d8747828c4ec547654c90cbcb3b6910 (patch) | |
tree | 50ba8da890b4f95538f1ac9f649e5f45bc727251 | |
parent | 4a3284a150774a28e1c38733860ede6d00fa1a52 (diff) |
sys/sys/limits.h:
- Fix visibilty test for LONG_BIT and WORD_BIT. `#if defined(__FOO_VISIBLE)'
is alays wrong because __FOO_VISIBLE is always defined (to 0 for
invisibility).
sys/<arch>/include/limits.h
sys/<arch>/include/_limits.h:
- Style fixes.
Submitted by: bde
Reviewed by: bsdmike
Approved by: re (scottl)
Notes
Notes:
svn path=/head/; revision=115164
-rw-r--r-- | sys/alpha/include/_limits.h | 6 | ||||
-rw-r--r-- | sys/alpha/include/limits.h | 2 | ||||
-rw-r--r-- | sys/amd64/include/_limits.h | 4 | ||||
-rw-r--r-- | sys/amd64/include/limits.h | 2 | ||||
-rw-r--r-- | sys/arm/include/_limits.h | 4 | ||||
-rw-r--r-- | sys/arm/include/limits.h | 2 | ||||
-rw-r--r-- | sys/i386/include/_limits.h | 4 | ||||
-rw-r--r-- | sys/i386/include/limits.h | 2 | ||||
-rw-r--r-- | sys/ia64/include/_limits.h | 4 | ||||
-rw-r--r-- | sys/ia64/include/limits.h | 2 | ||||
-rw-r--r-- | sys/powerpc/include/_limits.h | 4 | ||||
-rw-r--r-- | sys/powerpc/include/limits.h | 2 | ||||
-rw-r--r-- | sys/sparc64/include/_limits.h | 4 | ||||
-rw-r--r-- | sys/sparc64/include/limits.h | 2 | ||||
-rw-r--r-- | sys/sys/limits.h | 18 |
15 files changed, 32 insertions, 30 deletions
diff --git a/sys/alpha/include/_limits.h b/sys/alpha/include/_limits.h index 9e8dc467951d..7bca9edc3ac6 100644 --- a/sys/alpha/include/_limits.h +++ b/sys/alpha/include/_limits.h @@ -35,11 +35,9 @@ * $FreeBSD$ */ -#ifndef _MACHINE__LIMITS_H_ +#ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -51,6 +49,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f-1) /* min value for a signed char */ diff --git a/sys/alpha/include/limits.h b/sys/alpha/include/limits.h index cbbcf5926796..02ba71328158 100644 --- a/sys/alpha/include/limits.h +++ b/sys/alpha/include/limits.h @@ -35,7 +35,7 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/amd64/include/_limits.h b/sys/amd64/include/_limits.h index 2026e46f1457..1284b3117131 100644 --- a/sys/amd64/include/_limits.h +++ b/sys/amd64/include/_limits.h @@ -39,8 +39,6 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -52,6 +50,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f-1) /* min value for a signed char */ diff --git a/sys/amd64/include/limits.h b/sys/amd64/include/limits.h index 8a36831908f2..8437ddb01693 100644 --- a/sys/amd64/include/limits.h +++ b/sys/amd64/include/limits.h @@ -36,7 +36,7 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/arm/include/_limits.h b/sys/arm/include/_limits.h index 321a7693bb67..15c1f5ff4030 100644 --- a/sys/arm/include/_limits.h +++ b/sys/arm/include/_limits.h @@ -37,8 +37,6 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -50,6 +48,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ diff --git a/sys/arm/include/limits.h b/sys/arm/include/limits.h index 58dac20c167c..62a34ef82ddd 100644 --- a/sys/arm/include/limits.h +++ b/sys/arm/include/limits.h @@ -34,7 +34,7 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/i386/include/_limits.h b/sys/i386/include/_limits.h index 0bd4788317db..d0885d14cd60 100644 --- a/sys/i386/include/_limits.h +++ b/sys/i386/include/_limits.h @@ -37,8 +37,6 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -50,6 +48,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ diff --git a/sys/i386/include/limits.h b/sys/i386/include/limits.h index 58dac20c167c..62a34ef82ddd 100644 --- a/sys/i386/include/limits.h +++ b/sys/i386/include/limits.h @@ -34,7 +34,7 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/ia64/include/_limits.h b/sys/ia64/include/_limits.h index 76633e3156a8..cde400722ec3 100644 --- a/sys/ia64/include/_limits.h +++ b/sys/ia64/include/_limits.h @@ -39,8 +39,6 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -52,6 +50,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f-1) /* min value for a signed char */ diff --git a/sys/ia64/include/limits.h b/sys/ia64/include/limits.h index 7dc0de73937d..5b9f64734ce5 100644 --- a/sys/ia64/include/limits.h +++ b/sys/ia64/include/limits.h @@ -36,7 +36,7 @@ * @(#)limits.h 8.3 (Berkeley) 1/4/94 */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/powerpc/include/_limits.h b/sys/powerpc/include/_limits.h index 6bdc3d26df99..895c62454899 100644 --- a/sys/powerpc/include/_limits.h +++ b/sys/powerpc/include/_limits.h @@ -37,8 +37,6 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -50,6 +48,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f - 1) /* min value for a signed char */ diff --git a/sys/powerpc/include/limits.h b/sys/powerpc/include/limits.h index 58dac20c167c..62a34ef82ddd 100644 --- a/sys/powerpc/include/limits.h +++ b/sys/powerpc/include/limits.h @@ -34,7 +34,7 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/sparc64/include/_limits.h b/sys/sparc64/include/_limits.h index c5f8f7381094..353711c3cb16 100644 --- a/sys/sparc64/include/_limits.h +++ b/sys/sparc64/include/_limits.h @@ -30,8 +30,6 @@ #ifndef _MACHINE__LIMITS_H_ #define _MACHINE__LIMITS_H_ -#define __CHAR_BIT 8 /* number of bits in a char */ - /* * According to ANSI (section 2.2.4.2), the values below must be usable by * #if preprocessing directives. Additionally, the expression must have the @@ -43,6 +41,8 @@ * some other compilers as well, but this should not be depended on. */ +#define __CHAR_BIT 8 /* number of bits in a char */ + #define __SCHAR_MAX 0x7f /* max value for a signed char */ #define __SCHAR_MIN (-0x7f-1) /* min value for a signed char */ diff --git a/sys/sparc64/include/limits.h b/sys/sparc64/include/limits.h index 60ebf8f74468..b0de83dceee6 100644 --- a/sys/sparc64/include/limits.h +++ b/sys/sparc64/include/limits.h @@ -27,7 +27,7 @@ * $FreeBSD$ */ -#ifndef _MACHINE_LIMITS_H_ +#ifndef _MACHINE_LIMITS_H_ #define _MACHINE_LIMITS_H_ #if __GNUC__ diff --git a/sys/sys/limits.h b/sys/sys/limits.h index e2112c2a7eed..752ccb0b20b8 100644 --- a/sys/sys/limits.h +++ b/sys/sys/limits.h @@ -72,22 +72,24 @@ #define LLONG_MIN __LLONG_MIN /* min for a long long */ #endif -#if !defined(_ANSI_SOURCE) -#define SSIZE_MAX __SSIZE_MAX /* max value for a ssize_t */ +#if __POSIX_VISIBLE || __XSI_VISIBLE +#define SSIZE_MAX __SSIZE_MAX /* max value for an ssize_t */ +#endif -#if !defined(_POSIX_SOURCE) && !defined(_XOPEN_SOURCE) +#if __POSIX_VISIBLE >= 200112 || __XSI_VISIBLE #define SIZE_T_MAX __SIZE_T_MAX /* max value for a size_t */ -#define OFF_MAX __OFF_MAX /* max value for a off_t */ -#define OFF_MIN __OFF_MIN /* min value for a off_t */ +#define OFF_MAX __OFF_MAX /* max value for an off_t */ +#define OFF_MIN __OFF_MIN /* min value for an off_t */ +#endif +#if __BSD_VISIBLE #define UQUAD_MAX (__UQUAD_MAX) /* max value for a uquad_t */ #define QUAD_MAX (__QUAD_MAX) /* max value for a quad_t */ #define QUAD_MIN (__QUAD_MIN) /* min value for a quad_t */ -#endif /* !_POSIX_SOURCE && !_XOPEN_SOURCE */ -#endif /* !_ANSI_SOURCE */ +#endif -#if defined(__BSD_VISIBLE) || defined(__XSI_VISIBLE) +#if __XSI_VISIBLE #define LONG_BIT __LONG_BIT #define WORD_BIT __WORD_BIT #endif |