Futher changes to casts
[tinycc/daniel.git] / win32 / include / limits.h
blob5dc6025fd15bb5688b3ac17a33bac9564d4d8d7e
1 /*
2 * limits.h
4 * Defines constants for the sizes of integral types.
6 * NOTE: GCC should supply a version of this header and it should be safe to
7 * use that version instead of this one (maybe safer).
9 * This file is part of the Mingw32 package.
11 * Contributors:
12 * Created by Colin Peters <colin@bird.fu.is.saga-u.ac.jp>
14 * THIS SOFTWARE IS NOT COPYRIGHTED
16 * This source code is offered for use in the public domain. You may
17 * use, modify or distribute it freely.
19 * This code is distributed in the hope that it will be useful but
20 * WITHOUT ANY WARRANTY. ALL WARRANTIES, EXPRESS OR IMPLIED ARE HEREBY
21 * DISCLAIMED. This includes but is not limited to warranties of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
24 * $Revision: 1.2 $
25 * $Author: bellard $
26 * $Date: 2005/04/17 13:14:29 $
30 #ifndef _LIMITS_H_
31 #define _LIMITS_H_
33 /* All the headers include this file. */
34 #include <_mingw.h>
37 * File system limits
39 * TODO: NAME_MAX and OPEN_MAX are file system limits or not? Are they the
40 * same as FILENAME_MAX and FOPEN_MAX from stdio.h?
41 * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
42 * required for the NUL. TODO: Test?
44 #define PATH_MAX (259)
47 * Characteristics of the char data type.
49 * TODO: Is MB_LEN_MAX correct?
51 #define CHAR_BIT 8
52 #define MB_LEN_MAX 2
54 #define SCHAR_MIN (-128)
55 #define SCHAR_MAX 127
57 #define UCHAR_MAX 255
59 /* TODO: Is this safe? I think it might just be testing the preprocessor,
60 * not the compiler itself... */
61 #if ('\x80' < 0)
62 #define CHAR_MIN SCHAR_MIN
63 #define CHAR_MAX SCHAR_MAX
64 #else
65 #define CHAR_MIN 0
66 #define CHAR_MAX UCHAR_MAX
67 #endif
70 * Maximum and minimum values for ints.
72 #define INT_MAX 2147483647
73 #define INT_MIN (-INT_MAX-1)
75 #define UINT_MAX 0xffffffff
78 * Maximum and minimum values for shorts.
80 #define SHRT_MAX 32767
81 #define SHRT_MIN (-SHRT_MAX-1)
83 #define USHRT_MAX 0xffff
86 * Maximum and minimum values for longs and unsigned longs.
88 * TODO: This is not correct for Alphas, which have 64 bit longs.
90 #define LONG_MAX 2147483647L
92 #define LONG_MIN (-LONG_MAX-1)
94 #define ULONG_MAX 0xffffffffUL
98 * The GNU C compiler also allows 'long long int'
100 #if !defined(__STRICT_ANSI__) && defined(__GNUC__)
102 #define LONG_LONG_MAX 9223372036854775807LL
103 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
105 #define ULONG_LONG_MAX (2ULL * LONG_LONG_MAX + 1)
107 /* ISO C9x macro names */
108 #define LLONG_MAX LONG_LONG_MAX
109 #define LLONG_MIN LONG_LONG_MIN
110 #define ULLONG_MAX ULONG_LONG_MAX
112 #endif /* Not Strict ANSI and GNU C compiler */
115 #endif /* not _LIMITS_H_ */