From d8f337bb0a5367786ac391c3cd942613b9cd333f Mon Sep 17 00:00:00 2001 From: Robby Workman Date: Wed, 27 Dec 2017 00:48:28 -0600 Subject: [PATCH] libraries/rapidjson: Fix build with gcc7 I ran into this trying to build rapidjson on ARM -current: https://github.com/Tencent/rapidjson/pull/941 Signed-off-by: Robby Workman --- libraries/rapidjson/fix-build-on-gcc7.diff | 13 +++++++++++++ libraries/rapidjson/rapidjson.SlackBuild | 5 ++++- 2 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 libraries/rapidjson/fix-build-on-gcc7.diff diff --git a/libraries/rapidjson/fix-build-on-gcc7.diff b/libraries/rapidjson/fix-build-on-gcc7.diff new file mode 100644 index 0000000000..d55a477678 --- /dev/null +++ b/libraries/rapidjson/fix-build-on-gcc7.diff @@ -0,0 +1,13 @@ +diff -Nur rapidjson-1.1.0.orig/include/rapidjson/internal/regex.h rapidjson-1.1.0/include/rapidjson/internal/regex.h +--- rapidjson-1.1.0.orig/include/rapidjson/internal/regex.h 2016-08-25 02:59:05.000000000 -0500 ++++ rapidjson-1.1.0/include/rapidjson/internal/regex.h 2017-12-27 01:10:17.765316098 -0600 +@@ -29,6 +29,9 @@ + #ifdef __GNUC__ + RAPIDJSON_DIAG_PUSH + RAPIDJSON_DIAG_OFF(effc++) ++#if __GNUC__ >= 7 ++RAPIDJSON_DIAG_OFF(implicit-fallthrough) ++#endif + #endif + + #ifdef _MSC_VER diff --git a/libraries/rapidjson/rapidjson.SlackBuild b/libraries/rapidjson/rapidjson.SlackBuild index 85a240ac48..474a7d13e4 100644 --- a/libraries/rapidjson/rapidjson.SlackBuild +++ b/libraries/rapidjson/rapidjson.SlackBuild @@ -24,7 +24,7 @@ PRGNAM=rapidjson VERSION=${VERSION:-1.1.0} -BUILD=${BUILD:-1} +BUILD=${BUILD:-2} TAG=${TAG:-_SBo} if [ -z "$ARCH" ]; then @@ -69,6 +69,9 @@ find -L . \ \( -perm 666 -o -perm 664 -o -perm 640 -o -perm 600 -o -perm 444 \ -o -perm 440 -o -perm 400 \) -exec chmod 644 {} \; +# Patch for -current but should be harmless on -stable +patch -p1 < $CWD/fix-build-on-gcc7.diff + mkdir -p build cd build cmake \