Accepting request 619749 from home:cgiboudeaux
Fix build with gcc-8 OBS-URL: https://build.opensuse.org/request/show/619749 OBS-URL: https://build.opensuse.org/package/show/devel:libraries:c_c++/rapidjson?expand=0&rev=4
This commit is contained in:
parent
6d89ed0a4e
commit
f14dc08a28
36
ignore_gcc8_warnings.patch
Normal file
36
ignore_gcc8_warnings.patch
Normal file
@ -0,0 +1,36 @@
|
||||
commit 54dab1eebb0dea32d9ea49dad4fa9c98816c21ed
|
||||
Author: Romain Geissler <romain.geissler@amadeus.com>
|
||||
Date: Mon Feb 19 12:52:16 2018 +0100
|
||||
|
||||
Ignore GCC 8 warnings.
|
||||
|
||||
diff --git a/include/rapidjson/document.h b/include/rapidjson/document.h
|
||||
index eb6d7dcb..69ac924b 100644
|
||||
--- a/include/rapidjson/document.h
|
||||
+++ b/include/rapidjson/document.h
|
||||
@@ -2014,7 +2014,12 @@ private:
|
||||
if (count) {
|
||||
GenericValue* e = static_cast<GenericValue*>(allocator.Malloc(count * sizeof(GenericValue)));
|
||||
SetElementsPointer(e);
|
||||
+RAPIDJSON_DIAG_PUSH
|
||||
+#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
+RAPIDJSON_DIAG_OFF(class-memaccess) // ignore complains from gcc that no trivial copy constructor exists.
|
||||
+#endif
|
||||
std::memcpy(e, values, count * sizeof(GenericValue));
|
||||
+RAPIDJSON_DIAG_POP
|
||||
}
|
||||
else
|
||||
SetElementsPointer(0);
|
||||
@@ -2027,7 +2032,12 @@ private:
|
||||
if (count) {
|
||||
Member* m = static_cast<Member*>(allocator.Malloc(count * sizeof(Member)));
|
||||
SetMembersPointer(m);
|
||||
+RAPIDJSON_DIAG_PUSH
|
||||
+#if defined(__GNUC__) && __GNUC__ >= 8
|
||||
+RAPIDJSON_DIAG_OFF(class-memaccess) // ignore complains from gcc that no trivial copy constructor exists.
|
||||
+#endif
|
||||
std::memcpy(m, members, count * sizeof(Member));
|
||||
+RAPIDJSON_DIAG_POP
|
||||
}
|
||||
else
|
||||
SetMembersPointer(0);
|
@ -1,3 +1,8 @@
|
||||
-------------------------------------------------------------------
|
||||
Mon Jun 18 08:30:06 UTC 2018 - christophe@krop.fr
|
||||
|
||||
- Add upstream's patch ignore_gcc8_warnings.patch.
|
||||
|
||||
-------------------------------------------------------------------
|
||||
Fri Jun 2 08:03:34 UTC 2017 - christophe@krop.fr
|
||||
|
||||
|
@ -1,7 +1,7 @@
|
||||
#
|
||||
# spec file for package rapidjson
|
||||
#
|
||||
# Copyright (c) 2016 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
@ -22,18 +22,17 @@ Release: 0
|
||||
Summary: Fast JSON parser and generator for C++
|
||||
License: MIT
|
||||
Group: Development/Libraries/C and C++
|
||||
Url: http://rapidjson.org/
|
||||
URL: http://rapidjson.org/
|
||||
Source0: https://github.com/miloyip/rapidjson/archive/v%{version}.tar.gz
|
||||
Patch: remove_arch_specific_flags.patch
|
||||
Patch0: remove_arch_specific_flags.patch
|
||||
Patch1: fix_compilation_sle11sp4.patch
|
||||
Patch2: fix_compilation_gcc7.patch
|
||||
# PATCH-FIX-UPSTREAM -- ignore_gcc8_warnings.patch -- Ignore GCC 8 warnings.
|
||||
Patch3: ignore_gcc8_warnings.patch
|
||||
Patch10: fix_install_paths.patch
|
||||
%if 0%{?suse_version} < 1200
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
%endif
|
||||
BuildRequires: cmake
|
||||
BuildRequires: gcc-c++
|
||||
BuildRequires: pkg-config
|
||||
BuildRequires: pkgconfig
|
||||
|
||||
%description
|
||||
RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml.
|
||||
@ -54,7 +53,7 @@ RapidJSON is a JSON parser and generator for C++. It was inspired by RapidXml.
|
||||
%package devel
|
||||
Summary: Fast JSON parser and generator for C++
|
||||
Group: Development/Libraries/C and C++
|
||||
Provides: %{name} == %{version}
|
||||
Provides: %{name} = %{version}
|
||||
%if 0%{?suse_version} > 1200
|
||||
BuildArch: noarch
|
||||
%endif
|
||||
@ -65,9 +64,10 @@ This package contains development headers and examples.
|
||||
|
||||
%prep
|
||||
%setup -q
|
||||
%patch -p1
|
||||
%patch0 -p1
|
||||
%patch1 -p1
|
||||
%patch2 -p1
|
||||
%patch3 -p1
|
||||
%patch10 -p1
|
||||
|
||||
%build
|
||||
@ -78,8 +78,7 @@ make %{?_smp_mflags}
|
||||
%cmake_install
|
||||
|
||||
%files devel
|
||||
%defattr(-,root,root)
|
||||
%doc license.txt
|
||||
%license license.txt
|
||||
%dir %{_datadir}/cmake/RapidJSON
|
||||
%{_datadir}/cmake/RapidJSON/RapidJSONConfig.cmake
|
||||
%{_datadir}/cmake/RapidJSON/RapidJSONConfigVersion.cmake
|
||||
|
Loading…
Reference in New Issue
Block a user