Dr Andrew Scott G7VAV

My photo
 
April 2024
Mo Tu We Th Fr Sa Su
1 2 3 4 5 6 7
8 9 10 11 12 13 14
15 16 17 18 19 20 21
22 23 24 25 26 27 28
29 30 1 2 3 4 5
6 7 8 9 10 11 12


limits.h
001: /* Copyright (C) 1991, 1992, 1996, 1997, 1998, 1999, 2000, 2005
002:    Free Software Foundation, Inc.
003:    This file is part of the GNU C Library.
004: 
005:    The GNU C Library is free software; you can redistribute it and/or
006:    modify it under the terms of the GNU Lesser General Public
007:    License as published by the Free Software Foundation; either
008:    version 2.1 of the License, or (at your option) any later version.
009: 
010:    The GNU C Library is distributed in the hope that it will be useful,
011:    but WITHOUT ANY WARRANTY; without even the implied warranty of
012:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
013:    Lesser General Public License for more details.
014: 
015:    You should have received a copy of the GNU Lesser General Public
016:    License along with the GNU C Library; if not, write to the Free
017:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
018:    02111-1307 USA.  */
019: 
020: /*
021:  *      ISO C99 Standard: 7.10/5.2.4.2.1 Sizes of integer types <limits.h>
022:  */
023: 
024: #ifndef _LIBC_LIMITS_H_
025: #define _LIBC_LIMITS_H_ 1
026: 
027: #include <features.h>
028: 
029: 
030: /* Maximum length of any multibyte character in any locale.
031:    We define this value here since the gcc header does not define
032:    the correct value.  */
033: #define MB_LEN_MAX      16
034: 
035: 
036: /* If we are not using GNU CC we have to define all the symbols ourself.
037:    Otherwise use gcc's definitions (see below).  */
038: #if !defined __GNUC__ || __GNUC__ < 2
039: 
040: /* We only protect from multiple inclusion here, because all the other
041:    #include's protect themselves, and in GCC 2 we may #include_next through
042:    multiple copies of this file before we get to GCC's.  */
043: # ifndef _LIMITS_H
044: #  define _LIMITS_H     1
045: 
046: #include <bits/wordsize.h>
047: 
048: /* We don't have #include_next.
049:    Define ANSI <limits.h> for standard 32-bit words.  */
050: 
051: /* These assume 8-bit `char's, 16-bit `short int's,
052:    and 32-bit `int's and `long int's.  */
053: 
054: /* Number of bits in a `char'.  */
055: #  define CHAR_BIT      8
056: 
057: /* Minimum and maximum values a `signed char' can hold.  */
058: #  define SCHAR_MIN     (-128)
059: #  define SCHAR_MAX     127
060: 
061: /* Maximum value an `unsigned char' can hold.  (Minimum is 0.)  */
062: #  define UCHAR_MAX     255
063: 
064: /* Minimum and maximum values a `char' can hold.  */
065: #  ifdef __CHAR_UNSIGNED__
066: #   define CHAR_MIN     0
067: #   define CHAR_MAX     UCHAR_MAX
068: #  else
069: #   define CHAR_MIN     SCHAR_MIN
070: #   define CHAR_MAX     SCHAR_MAX
071: #  endif
072: 
073: /* Minimum and maximum values a `signed short int' can hold.  */
074: #  define SHRT_MIN      (-32768)
075: #  define SHRT_MAX      32767
076: 
077: /* Maximum value an `unsigned short int' can hold.  (Minimum is 0.)  */
078: #  define USHRT_MAX     65535
079: 
080: /* Minimum and maximum values a `signed int' can hold.  */
081: #  define INT_MIN       (-INT_MAX - 1)
082: #  define INT_MAX       2147483647
083: 
084: /* Maximum value an `unsigned int' can hold.  (Minimum is 0.)  */
085: #  define UINT_MAX      4294967295U
086: 
087: /* Minimum and maximum values a `signed long int' can hold.  */
088: #  if __WORDSIZE == 64
089: #   define LONG_MAX     9223372036854775807L
090: #  else
091: #   define LONG_MAX     2147483647L
092: #  endif
093: #  define LONG_MIN      (-LONG_MAX - 1L)
094: 
095: /* Maximum value an `unsigned long int' can hold.  (Minimum is 0.)  */
096: #  if __WORDSIZE == 64
097: #   define ULONG_MAX    18446744073709551615UL
098: #  else
099: #   define ULONG_MAX    4294967295UL
100: #  endif
101: 
102: #  ifdef __USE_ISOC99
103: 
104: /* Minimum and maximum values a `signed long long int' can hold.  */
105: #   define LLONG_MAX    9223372036854775807LL
106: #   define LLONG_MIN    (-LLONG_MAX - 1LL)
107: 
108: /* Maximum value an `unsigned long long int' can hold.  (Minimum is 0.)  */
109: #   define ULLONG_MAX   18446744073709551615ULL
110: 
111: #  endif /* ISO C99 */
112: 
113: # endif /* limits.h  */
114: #endif  /* GCC 2.  */
115: 
116: #endif  /* !_LIBC_LIMITS_H_ */
117: 
118:  /* Get the compiler's limits.h, which defines almost all the ISO constants.
119: 
120:     We put this #include_next outside the double inclusion check because
121:     it should be possible to include this file more than once and still get
122:     the definitions from gcc's header.  */
123: #if defined __GNUC__ && !defined _GCC_LIMITS_H_
124: /* `_GCC_LIMITS_H_' is what GCC's file defines.  */
125: # include_next <limits.h>
126: #endif
127: 
128: /* The <limits.h> files in some gcc versions don't define LLONG_MIN,
129:    LLONG_MAX, and ULLONG_MAX.  Instead only the values gcc defined for
130:    ages are available.  */
131: #if defined __USE_ISOC99 && defined __GNUC__
132: # ifndef LLONG_MIN
133: #  define LLONG_MIN     (-LLONG_MAX-1)
134: # endif
135: # ifndef LLONG_MAX
136: #  define LLONG_MAX     __LONG_LONG_MAX__
137: # endif
138: # ifndef ULLONG_MAX
139: #  define ULLONG_MAX    (LLONG_MAX * 2ULL + 1)
140: # endif
141: #endif
142: 
143: #ifdef  __USE_POSIX
144: /* POSIX adds things to <limits.h>.  */
145: # include <bits/posix1_lim.h>
146: #endif
147: 
148: #ifdef  __USE_POSIX2
149: # include <bits/posix2_lim.h>
150: #endif
151: 
152: #ifdef  __USE_XOPEN
153: # include <bits/xopen_lim.h>
154: #endif
155: 


for client 3.144.124.232
© Andrew Scott 2006 - 2024,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/