Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/include/stdlib.h2
-rw-r--r--newlib/libc/include/sys/config.h6
2 files changed, 7 insertions, 1 deletions
diff --git a/newlib/libc/include/stdlib.h b/newlib/libc/include/stdlib.h
index a61517f26..326213b3c 100644
--- a/newlib/libc/include/stdlib.h
+++ b/newlib/libc/include/stdlib.h
@@ -37,7 +37,7 @@ typedef struct
#define EXIT_FAILURE 1
#define EXIT_SUCCESS 0
-#define RAND_MAX 0x7fffffff
+#define RAND_MAX __RAND_MAX
#if (defined(__CYGWIN__) || defined(__CYGWIN__)) && ! defined(_COMPILING_NEWLIB)
extern __declspec(dllimport) int __mb_cur_max;
diff --git a/newlib/libc/include/sys/config.h b/newlib/libc/include/sys/config.h
index e274119bc..8420a8d86 100644
--- a/newlib/libc/include/sys/config.h
+++ b/newlib/libc/include/sys/config.h
@@ -111,5 +111,11 @@ typedef unsigned int __uint32_t;
#define _POINTER_INT long
#endif
+#undef __RAND_MAX
+#if INT_MAX == 32767
+#define __RAND_MAX 32767
+#else
+#define __RAND_MAX 0x7fffffff
+#endif
#endif /* __SYS_CONFIG_H__ */