diff options
author | kan <kan@FreeBSD.org> | 2003-05-19 20:29:07 +0000 |
---|---|---|
committer | kan <kan@FreeBSD.org> | 2003-05-19 20:29:07 +0000 |
commit | f35a6040c12d1b827823ac9814f74050f3706e1e (patch) | |
tree | 50ba8da890b4f95538f1ac9f649e5f45bc727251 | |
parent | 4f7eb6b57a943cfa7207301cec09aa12d557892a (diff) | |
download | FreeBSD-src-f35a6040c12d1b827823ac9814f74050f3706e1e.zip FreeBSD-src-f35a6040c12d1b827823ac9814f74050f3706e1e.tar.gz |
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)
-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 9e8dc46..7bca9ed 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 cbbcf59..02ba713 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 2026e46..1284b31 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 8a36831..8437ddb 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 321a769..15c1f5f 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 58dac20..62a34ef 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 0bd4788..d0885d1 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 58dac20..62a34ef 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 76633e3..cde4007 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 7dc0de7..5b9f647 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 6bdc3d2..895c624 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 58dac20..62a34ef 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 c5f8f73..353711c 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 60ebf8f..b0de83d 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 e2112c2..752ccb0 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 |