Repair overflow condition where WCHAR_MAX != INT_MAX

182e1060dc

Add MISSING option to the default build on armv6.

PR:		194183
Submitted by:	mikael.urankar@gmail.com, Adreas Schwab
Approved by:	maintainer timeout (3 months without PR comment)
This commit is contained in:
Sean Bruno 2015-02-10 22:24:01 +00:00
parent 6908db6ef6
commit 24d46ae772
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=378808
2 changed files with 24 additions and 0 deletions

View File

@ -91,6 +91,8 @@ X11_DESC= X11() graphics device
OPTIONS_DEFAULT+= GHOSTSCRIPT INFO_MANUALS JPEG LIBR PANGOCAIRO PNG \
TCLTK TIFF X11
OPTIONS_DEFAULT_armv6+= MISSING
.endif # !LIBR_SLAVEPORT
PLIST_SUB= R_SOVERSION="${R_SOVERSION}" \
RBLAS_SOVERSION="${RBLAS_SOVERSION}" \

View File

@ -0,0 +1,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