Home | History | Annotate | Download | only in include
      1 /**
      2  * This file has no copyright assigned and is placed in the Public Domain.
      3  * This file is part of the mingw-w64 runtime package.
      4  * No warranty is given; refer to the file DISCLAIMER.PD within this package.
      5  */
      6 #include <crtdefs.h>
      7 
      8 #ifndef _INC_LIMITS
      9 #define _INC_LIMITS
     10 
     11 /*
     12  * File system limits
     13  *
     14  * NOTE: Apparently the actual size of PATH_MAX is 260, but a space is
     15  *       required for the NUL. TODO: Test?
     16  * NOTE: PATH_MAX is the POSIX equivalent for Microsoft's MAX_PATH; the two
     17  *       are semantically identical, with a limit of 259 characters for the
     18  *       path name, plus one for a terminating NUL, for a total of 260.
     19  */
     20 #define PATH_MAX	260
     21 
     22 #define CHAR_BIT 8
     23 #define SCHAR_MIN (-128)
     24 #define SCHAR_MAX 127
     25 #define UCHAR_MAX 0xff
     26 
     27 #define CHAR_MIN SCHAR_MIN
     28 #define CHAR_MAX SCHAR_MAX
     29 
     30 #define MB_LEN_MAX 5
     31 #define SHRT_MIN (-32768)
     32 #define SHRT_MAX 32767
     33 #define USHRT_MAX 0xffffU
     34 #define INT_MIN (-2147483647 - 1)
     35 #define INT_MAX 2147483647
     36 #define UINT_MAX 0xffffffffU
     37 #define LONG_MIN (-2147483647L - 1)
     38 #define LONG_MAX 2147483647L
     39 #define ULONG_MAX 0xffffffffUL
     40 #define LLONG_MAX 9223372036854775807ll
     41 #define LLONG_MIN (-9223372036854775807ll - 1)
     42 #define ULLONG_MAX 0xffffffffffffffffull
     43 
     44 #define _I8_MIN (-127 - 1)
     45 #define _I8_MAX 127
     46 #define _UI8_MAX 0xffu
     47 
     48 #define _I16_MIN (-32767 - 1)
     49 #define _I16_MAX 32767
     50 #define _UI16_MAX 0xffffu
     51 
     52 #define _I32_MIN (-2147483647 - 1)
     53 #define _I32_MAX 2147483647
     54 #define _UI32_MAX 0xffffffffu
     55 
     56 #if defined(__GNUC__)
     57 #undef LONG_LONG_MAX
     58 #define LONG_LONG_MAX 9223372036854775807ll
     59 #undef LONG_LONG_MIN
     60 #define LONG_LONG_MIN (-LONG_LONG_MAX-1)
     61 #undef ULONG_LONG_MAX
     62 #define ULONG_LONG_MAX (2ull * LONG_LONG_MAX + 1ull)
     63 #endif
     64 
     65 #define _I64_MIN (-9223372036854775807ll - 1)
     66 #define _I64_MAX 9223372036854775807ll
     67 #define _UI64_MAX 0xffffffffffffffffull
     68 
     69 #ifndef SIZE_MAX
     70 #ifdef _WIN64
     71 #define SIZE_MAX _UI64_MAX
     72 #else
     73 #define SIZE_MAX UINT_MAX
     74 #endif
     75 #endif
     76 
     77 #ifndef SSIZE_MAX
     78 #ifdef _WIN64
     79 #define SSIZE_MAX _I64_MAX
     80 #else
     81 #define SSIZE_MAX INT_MAX
     82 #endif
     83 #endif
     84 
     85 #ifdef _POSIX_
     86 #define _POSIX_ARG_MAX 4096
     87 #define _POSIX_CHILD_MAX 6
     88 #define _POSIX_LINK_MAX 8
     89 #define _POSIX_MAX_CANON 255
     90 #define _POSIX_MAX_INPUT 255
     91 #define _POSIX_NAME_MAX 14
     92 #define _POSIX_NGROUPS_MAX 0
     93 #define _POSIX_OPEN_MAX 16
     94 #define _POSIX_PATH_MAX 255
     95 #define _POSIX_PIPE_BUF 512
     96 #define _POSIX_SSIZE_MAX 32767
     97 #define _POSIX_STREAM_MAX 8
     98 #define _POSIX_TZNAME_MAX 3
     99 #define ARG_MAX 14500
    100 #define LINK_MAX 1024
    101 #define MAX_CANON _POSIX_MAX_CANON
    102 #define MAX_INPUT _POSIX_MAX_INPUT
    103 #define NAME_MAX 255
    104 #define NGROUPS_MAX 16
    105 #define OPEN_MAX 32
    106 #undef PATH_MAX
    107 #define PATH_MAX 512
    108 #define PIPE_BUF _POSIX_PIPE_BUF
    109 /*#define SSIZE_MAX _POSIX_SSIZE_MAX*/
    110 #define STREAM_MAX 20
    111 #define TZNAME_MAX 10
    112 #endif
    113 
    114 #endif /* _INC_LIMITS */
    115