VirtualBox

Changeset 829 in vbox


Ignore:
Timestamp:
Feb 12, 2007 10:38:01 AM (18 years ago)
Author:
vboxsync
Message:

No-CRT limits.h

File:
1 copied

Legend:

Unmodified
Added
Removed
  • trunk/include/iprt/nocrt/limits.h

    r828 r829  
    11/** @file
    2  * InnoTek Portable Runtime / No-CRT - Our own setjmp header.
     2 * InnoTek Portable Runtime / No-CRT - Our own limits header.
    33 */
    44
     
    1919 */
    2020
    21 #ifndef __setjmp_h__
    22 #define __setjmp_h__
     21#ifndef __limits_h__
     22#define __limits_h__
    2323
    2424#include <iprt/types.h>
    2525
    26 __BEGIN_DECLS
    27 
    28 #ifdef __AMD64__
    29 typedef uint64_t RT_NOCRT(jmp_buf)[8];
     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
    3033#else
    31 typedef uint32_t RT_NOCRT(jmp_buf)[6+2];
     34# define CHAR_MAX       UCHAR_MAX
     35# define CHAR_MIN       0
    3236#endif
    3337
    34 extern int RT_NOCRT(setjmp)(RT_NOCRT(jmp_buf));
    35 extern int RT_NOCRT(longjmp)(RT_NOCRT(jmp_buf), int);
     38#define WORD_BIT        16
     39#define USHRT_MAX       0xffff
     40#define SHRT_MAX        0x7fff
     41#define SHRT_MIN        (-0x7fff - 1)
    3642
    37 #ifndef RT_WITHOUT_NOCRT_WRAPPERS
    38 # define jmp_buf RT_NOCRT(jmp_buf)
    39 # define setjmp RT_NOCRT(setjmp)
    40 # define longjmp RT_NOCRT(longjmp)
     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?"
    4160#endif
    4261
    43 __END_DECLS
     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*/
    4479
    4580#endif
Note: See TracChangeset for help on using the changeset viewer.

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