limits.h 1.15 KB
Newer Older
1 2 3
#ifndef __WINE_LIMITS_H
#define __WINE_LIMITS_H

4 5
#include <crtdefs.h>

6
#define CHAR_BIT 8
7
#define MB_LEN_MAX 5
8

9 10 11
#define SCHAR_MIN (-0x80)
#define SCHAR_MAX   0x7f
#define UCHAR_MAX   0xff
12

13 14 15 16 17 18
#ifdef __CHAR_UNSIGNED__
# define CHAR_MIN 0
# define CHAR_MAX UCHAR_MAX
#else
# define CHAR_MIN SCHAR_MIN
# define CHAR_MAX SCHAR_MAX
19 20
#endif

21 22 23 24
#define SHRT_MIN  (-0x8000)
#define SHRT_MAX    0x7fff
#define USHRT_MAX   0xffff

25
#define INT_MIN   (-0x7fffffff - 1)
26
#define INT_MAX     0x7fffffff
27
#define UINT_MAX    0xffffffffU
28

29
#define LONG_MIN  (-0x7fffffffL - 1L)
30 31 32
#define LONG_MAX    0x7fffffffL
#define ULONG_MAX   0xffffffffUL

33 34 35 36
#define LLONG_MAX   (((__int64)0x7fffffff << 32) | 0xffffffff)
#define LLONG_MIN   (-LLONG_MAX-1)
#define ULLONG_MAX  (((unsigned __int64)0xffffffff << 32) | 0xffffffff)

37 38 39 40 41 42 43 44
#define _I64_MAX    (((__int64)0x7fffffff << 32) | 0xffffffff)
#define _I64_MIN    (-_I64_MAX-1)
#define _UI64_MAX   (((unsigned __int64)0xffffffff << 32) | 0xffffffff)

#define I64_MIN  _I64_MIN
#define I64_MAX  _I64_MAX
#define UI64_MAX _UI64_MAX

45 46 47 48 49 50 51 52
#ifndef SIZE_MAX
# ifdef _WIN64
#  define SIZE_MAX UI64_MAX
# else
#  define SIZE_MAX UINT_MAX
# endif
#endif

53
#endif /* __WINE_LIMITS_H */