Fix char limits
By the standard CHAR_MIN and CHAR_MAX should be 0 and UCHAR_MAX respectively when char implementation is unsigned ( -fno-signed-char)
This commit is contained in:
parent
1073b379c8
commit
82611f5e6d
1 changed files with 5 additions and 0 deletions
|
@ -23,8 +23,13 @@
|
||||||
#define SCHAR_MAX 127
|
#define SCHAR_MAX 127
|
||||||
#define UCHAR_MAX 0xff
|
#define UCHAR_MAX 0xff
|
||||||
|
|
||||||
|
#ifndef __CHAR_UNSIGNED__
|
||||||
#define CHAR_MIN SCHAR_MIN
|
#define CHAR_MIN SCHAR_MIN
|
||||||
#define CHAR_MAX SCHAR_MAX
|
#define CHAR_MAX SCHAR_MAX
|
||||||
|
#else
|
||||||
|
#define CHAR_MIN 0
|
||||||
|
#define CHAR_MAX UCHAR_MAX
|
||||||
|
#endif
|
||||||
|
|
||||||
#define MB_LEN_MAX 5
|
#define MB_LEN_MAX 5
|
||||||
#define SHRT_MIN (-32768)
|
#define SHRT_MIN (-32768)
|
||||||
|
|
Loading…
Reference in a new issue