remove __STDC_LIMIT_MACROS and __STDC_CONSTANT_MACROS checks in stdint.h
[musl] / include / limits.h
index 56f7a12..54d1940 100644 (file)
@@ -1,18 +1,28 @@
 #ifndef _LIMITS_H
 #define _LIMITS_H
 
+#include <features.h>
+
 /* Most limits are system-specific */
 
 #include <bits/limits.h>
 
+/* Support signed or unsigned plain-char */
+
+#if '\0'-1 > 0
+#define CHAR_MIN 0
+#define CHAR_MAX 255
+#else
+#define CHAR_MIN (-128)
+#define CHAR_MAX 127
+#endif
+
 /* Some universal constants... */
 
 #define CHAR_BIT 8
 #define SCHAR_MIN (-128)
 #define SCHAR_MAX 127
 #define UCHAR_MAX 255
-#define CHAR_MIN (-128)
-#define CHAR_MAX 127
 #define SHRT_MIN  (-1-0x7fff)
 #define SHRT_MAX  0x7fff
 #define USHRT_MAX 0xffff
@@ -27,7 +37,7 @@
 #define MB_LEN_MAX 4
 
 #if defined(_POSIX_SOURCE) || defined(_POSIX_C_SOURCE) \
- || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE)
+ || defined(_XOPEN_SOURCE) || defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
 
 #define PIPE_BUF 4096
 #define PAGESIZE PAGE_SIZE
 
 /* Implementation choices... */
 
-#define PTHREAD_KEYS_MAX  1024
-#define PTHREAD_STACK_MIN PAGE_SIZE
+#define PTHREAD_KEYS_MAX 128
+#define PTHREAD_STACK_MIN 2048
 #define PTHREAD_DESTRUCTOR_ITERATIONS 4
 #define SEM_VALUE_MAX 0x7fffffff
 #define SEM_NSEMS_MAX 256
 #define DELAYTIMER_MAX 0x7fffffff
 #define MQ_PRIO_MAX 32768
+#define LOGIN_NAME_MAX 256
 
 /* Arbitrary numbers... */