VirtualBox

source: vbox/trunk/include/iprt/nocrt/limits.h@ 3631

Last change on this file since 3631 was 3631, checked in by vboxsync, 17 years ago

iprt_hdr_h -> _iprt_hdr_h

File size: 2.4 KB
Line 
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 * If you received this file as part of a commercial VirtualBox
17 * distribution, then only the terms of your commercial VirtualBox
18 * license agreement apply instead of the previous paragraph.
19 */
20
21#ifndef ___iprt_nocrt_limits_h
22#define ___iprt_nocrt_limits_h
23
24#include <iprt/types.h>
25
26#define CHAR_BIT 8
27#define SCHAR_MAX 0x7f
28#define SCHAR_MIN (-0x7f - 1)
29#define UCHAR_MAX 0xff
30#if 1 /* ASSUMES: signed char */
31# define CHAR_MAX SCHAR_MAX
32# define CHAR_MIN SCHAR_MIN
33#else
34# define CHAR_MAX UCHAR_MAX
35# define CHAR_MIN 0
36#endif
37
38#define WORD_BIT 16
39#define USHRT_MAX 0xffff
40#define SHRT_MAX 0x7fff
41#define SHRT_MIN (-0x7fff - 1)
42
43/* ASSUMES 32-bit int */
44#define UINT_MAX 0xffffffffU
45#define INT_MAX 0x7fffffff
46#define INT_MIN (-0x7fffffff - 1)
47
48#if defined(__X86__) || defined(__WIN__)
49# define LONG_BIT 32
50# define ULONG_MAX 0xffffffffU
51# define LONG_MAX 0x7fffffff
52# define LONG_MIN (-0x7fffffff - 1)
53#elif defined(__AMD64__)
54# define LONG_BIT 64
55# define ULONG_MAX UINT64_C(0xffffffffffffffff)
56# define LONG_MAX INT64_C(0x7fffffffffffffff)
57# define LONG_MIN (INT64_C(-0x7fffffffffffffff) - 1)
58#else
59# error "huh?"
60#endif
61
62#define LLONG_BIT 64
63#define ULLONG_MAX UINT64_C(0xffffffffffffffff)
64#define LLONG_MAX INT64_C(0x7fffffffffffffff)
65#define LLONG_MIN (INT64_C(-0x7fffffffffffffff) - 1)
66
67#if ARCH_BITS == 32
68# define SIZE_T_MAX 0xffffffffU
69# define SSIZE_MAX 0x7fffffff
70#elif ARCH_BITS == 64
71# define SIZE_T_MAX UINT64_C(0xffffffffffffffff)
72# define SSIZE_MAX INT64_C(0x7fffffffffffffff)
73#else
74# error "huh?"
75#endif
76
77/*#define OFF_MAX __OFF_MAX
78#define OFF_MIN __OFF_MIN*/
79
80#endif
81
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette