1 | /** @file
|
---|
2 | * innotek Portable Runtime / No-CRT - Our own limits header.
|
---|
3 | */
|
---|
4 |
|
---|
5 | /*
|
---|
6 | * Copyright (C) 2006-2007 innotek GmbH
|
---|
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 as published by the Free Software Foundation,
|
---|
12 | * in version 2 as it comes in the "COPYING" file of the VirtualBox OSE
|
---|
13 | * distribution. VirtualBox OSE is distributed in the hope that it will
|
---|
14 | * be useful, but WITHOUT ANY WARRANTY of any kind.
|
---|
15 | */
|
---|
16 |
|
---|
17 | #ifndef ___iprt_nocrt_limits_h
|
---|
18 | #define ___iprt_nocrt_limits_h
|
---|
19 |
|
---|
20 | #include <iprt/types.h>
|
---|
21 |
|
---|
22 | #define CHAR_BIT 8
|
---|
23 | #define SCHAR_MAX 0x7f
|
---|
24 | #define SCHAR_MIN (-0x7f - 1)
|
---|
25 | #define UCHAR_MAX 0xff
|
---|
26 | #if 1 /* ASSUMES: signed char */
|
---|
27 | # define CHAR_MAX SCHAR_MAX
|
---|
28 | # define CHAR_MIN SCHAR_MIN
|
---|
29 | #else
|
---|
30 | # define CHAR_MAX UCHAR_MAX
|
---|
31 | # define CHAR_MIN 0
|
---|
32 | #endif
|
---|
33 |
|
---|
34 | #define WORD_BIT 16
|
---|
35 | #define USHRT_MAX 0xffff
|
---|
36 | #define SHRT_MAX 0x7fff
|
---|
37 | #define SHRT_MIN (-0x7fff - 1)
|
---|
38 |
|
---|
39 | /* ASSUMES 32-bit int */
|
---|
40 | #define UINT_MAX 0xffffffffU
|
---|
41 | #define INT_MAX 0x7fffffff
|
---|
42 | #define INT_MIN (-0x7fffffff - 1)
|
---|
43 |
|
---|
44 | #if defined(RT_ARCH_X86) || defined(RT_OS_WINDOWS)
|
---|
45 | # define LONG_BIT 32
|
---|
46 | # define ULONG_MAX 0xffffffffU
|
---|
47 | # define LONG_MAX 0x7fffffff
|
---|
48 | # define LONG_MIN (-0x7fffffff - 1)
|
---|
49 | #elif defined(RT_ARCH_AMD64)
|
---|
50 | # define LONG_BIT 64
|
---|
51 | # define ULONG_MAX UINT64_C(0xffffffffffffffff)
|
---|
52 | # define LONG_MAX INT64_C(0x7fffffffffffffff)
|
---|
53 | # define LONG_MIN (INT64_C(-0x7fffffffffffffff) - 1)
|
---|
54 | #else
|
---|
55 | # error "huh?"
|
---|
56 | #endif
|
---|
57 |
|
---|
58 | #define LLONG_BIT 64
|
---|
59 | #define ULLONG_MAX UINT64_C(0xffffffffffffffff)
|
---|
60 | #define LLONG_MAX INT64_C(0x7fffffffffffffff)
|
---|
61 | #define LLONG_MIN (INT64_C(-0x7fffffffffffffff) - 1)
|
---|
62 |
|
---|
63 | #if ARCH_BITS == 32
|
---|
64 | # define SIZE_T_MAX 0xffffffffU
|
---|
65 | # define SSIZE_MAX 0x7fffffff
|
---|
66 | #elif ARCH_BITS == 64
|
---|
67 | # define SIZE_T_MAX UINT64_C(0xffffffffffffffff)
|
---|
68 | # define SSIZE_MAX INT64_C(0x7fffffffffffffff)
|
---|
69 | #else
|
---|
70 | # error "huh?"
|
---|
71 | #endif
|
---|
72 |
|
---|
73 | /*#define OFF_MAX __OFF_MAX
|
---|
74 | #define OFF_MIN __OFF_MIN*/
|
---|
75 |
|
---|
76 | #endif
|
---|
77 |
|
---|