summaryrefslogtreecommitdiff
path: root/math/R/files/patch-src_extra_tre_tre-internal.h
blob: b9d39324d7720b055a94a7d67b24fd71b4ef2b4d (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
--- src/extra/tre/tre-internal.h.orig	2015-01-20 15:25:01 UTC
+++ src/extra/tre/tre-internal.h
@@ -17,6 +17,7 @@
 #include <wctype.h>
 #endif /* !HAVE_WCTYPE_H */
 
+#include <limits.h>
 #include <ctype.h>
 #include "tre.h"
 
@@ -48,7 +49,11 @@
 
 /* Wide characters. */
 typedef wint_t tre_cint_t;
+#if WCHAR_MAX <= INT_MAX
 #define TRE_CHAR_MAX WCHAR_MAX
+#else /* WCHAR_MAX > INT_MAX */
+#define TRE_CHAR_MAX INT_MAX
+#endif
 
 #ifdef TRE_MULTIBYTE
 #define TRE_MB_CUR_MAX MB_CUR_MAX