Change config generating Perl script to cast int literals to char in default
config file to avoid narrowing conversions.
Closes: https://github.com/gentoo/gentoo/pull/2411
Signed-off-by: David Seifert <soap@gentoo.org>
--- /dev/null
+Fix C++14 compilation errors. Add casting int literals to char in config
+generator to avoid narrowing conversions.
+Gentoo bug: https://bugs.gentoo.org/show_bug.cgi?id=595048
+
+--- a/src/mkdefcfg.pl
++++ b/src/mkdefcfg.pl
+@@ -24,8 +24,8 @@
+
+ @c = split(//, $buf);
+ for ($i = 0; $i < $len; $i++) {
+- $out .= sprintf("0x%02X", ord($c[$i]));
+- if ($n++ % 10) {
++ $out .= sprintf("(char)0x%02X", ord($c[$i]));
++ if ($n++ % 5) {
+ $out .= ", ";
+ } else {
+ $out .= ",\n";
"${FILESDIR}"/fte-gcc34 \
"${FILESDIR}"/${PN}-new_keyword.patch \
"${FILESDIR}"/${PN}-slang.patch \
- "${FILESDIR}"/${PN}-interix.patch
+ "${FILESDIR}"/${PN}-interix.patch \
+ "${FILESDIR}"/${PN}-cpp14.patch # bug #595048
[[ -e /usr/include/linux/keyboard.h ]] && \
sed /usr/include/linux/keyboard.h -e '/wait.h/d' > src/hacked_keyboard.h