1 | /** @file
|
---|
2 | * IPRT / No-CRT - Our own limits header.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 Sun Microsystems, Inc.
|
---|
7 | *
|
---|
8 | * This file is part of VirtualBox Open Source Edition (OSE), as
|
---|
9 | * available from http://www.virtualbox.org. This file is free software;
|
---|
10 | * you can redistribute it and/or modify it under the terms of the GNU
|
---|
11 | * General Public License (GPL) as published by the Free Software
|
---|
12 | * Foundation, in version 2 as it comes in the "COPYING" file of the
|
---|
13 | * VirtualBox OSE distribution. VirtualBox OSE is distributed in the
|
---|
14 | * hope that it will be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | *
|
---|
16 | * The contents of this file may alternatively be used under the terms
|
---|
17 | * of the Common Development and Distribution License Version 1.0
|
---|
18 | * (CDDL) only, as it comes in the "COPYING.CDDL" file of the
|
---|
19 | * VirtualBox OSE distribution, in which case the provisions of the
|
---|
20 | * CDDL are applicable instead of those of the GPL.
|
---|
21 | *
|
---|
22 | * You may elect to license modified versions of this file under the
|
---|
23 | * terms and conditions of either the GPL or the CDDL or both.
|
---|
24 | *
|
---|
25 | * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa
|
---|
26 | * Clara, CA 95054 USA or visit http://www.sun.com if you need
|
---|
27 | * additional information or have any questions.
|
---|
28 | */
|
---|
29 |
|
---|
30 | #ifndef ___iprt_nocrt_limits_h
|
---|
31 | #define ___iprt_nocrt_limits_h
|
---|
32 |
|
---|
33 | #include <iprt/types.h>
|
---|
34 |
|
---|
35 | #define CHAR_BIT 8
|
---|
36 | #define SCHAR_MAX 0x7f
|
---|
37 | #define SCHAR_MIN (-0x7f - 1)
|
---|
38 | #define UCHAR_MAX 0xff
|
---|
39 | #if 1 /* ASSUMES: signed char */
|
---|
40 | # define CHAR_MAX SCHAR_MAX
|
---|
41 | # define CHAR_MIN SCHAR_MIN
|
---|
42 | #else
|
---|
43 | # define CHAR_MAX UCHAR_MAX
|
---|
44 | # define CHAR_MIN 0
|
---|
45 | #endif
|
---|
46 |
|
---|
47 | #define WORD_BIT 16
|
---|
48 | #define USHRT_MAX 0xffff
|
---|
49 | #define SHRT_MAX 0x7fff
|
---|
50 | #define SHRT_MIN (-0x7fff - 1)
|
---|
51 |
|
---|
52 | /* ASSUMES 32-bit int */
|
---|
53 | #define UINT_MAX 0xffffffffU
|
---|
54 | #define INT_MAX 0x7fffffff
|
---|
55 | #define INT_MIN (-0x7fffffff - 1)
|
---|
56 |
|
---|
57 | #if defined(RT_ARCH_X86) || defined(RT_OS_WINDOWS)
|
---|
58 | # define LONG_BIT 32
|
---|
59 | # define ULONG_MAX 0xffffffffU
|
---|
60 | # define LONG_MAX 0x7fffffff
|
---|
61 | # define LONG_MIN (-0x7fffffff - 1)
|
---|
62 | #elif defined(RT_ARCH_AMD64)
|
---|
63 | # define LONG_BIT 64
|
---|
64 | # define ULONG_MAX UINT64_C(0xffffffffffffffff)
|
---|
65 | # define LONG_MAX INT64_C(0x7fffffffffffffff)
|
---|
66 | # define LONG_MIN (INT64_C(-0x7fffffffffffffff) - 1)
|
---|
67 | #else
|
---|
68 | # error "huh?"
|
---|
69 | #endif
|
---|
70 |
|
---|
71 | #define LLONG_BIT 64
|
---|
72 | #define ULLONG_MAX UINT64_C(0xffffffffffffffff)
|
---|
73 | #define LLONG_MAX INT64_C(0x7fffffffffffffff)
|
---|
74 | #define LLONG_MIN (INT64_C(-0x7fffffffffffffff) - 1)
|
---|
75 |
|
---|
76 | #if ARCH_BITS == 32
|
---|
77 | # define SIZE_T_MAX 0xffffffffU
|
---|
78 | # define SSIZE_MAX 0x7fffffff
|
---|
79 | #elif ARCH_BITS == 64
|
---|
80 | # define SIZE_T_MAX UINT64_C(0xffffffffffffffff)
|
---|
81 | # define SSIZE_MAX INT64_C(0x7fffffffffffffff)
|
---|
82 | #else
|
---|
83 | # error "huh?"
|
---|
84 | #endif
|
---|
85 |
|
---|
86 | /*#define OFF_MAX __OFF_MAX
|
---|
87 | #define OFF_MIN __OFF_MIN*/
|
---|
88 |
|
---|
89 | #endif
|
---|
90 |
|
---|