Patched for C++11 compatibility

This commit is contained in:
Jonathan Wakely 2016-02-02 23:38:53 +00:00
parent 3eba0f0f08
commit dfed6c60f3
3 changed files with 56 additions and 1 deletions

View File

@ -0,0 +1,23 @@
From 27399309009314f56cdfbd8333f287b1a9b7a3a6 Mon Sep 17 00:00:00 2001
From: Nuno Lopes <nlopes@microsoft.com>
Date: Fri, 27 Nov 2015 12:13:44 +0000
Subject: [PATCH] fix build with clang
Signed-off-by: Nuno Lopes <nlopes@microsoft.com>
---
src/util/mpz.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/mpz.cpp b/src/util/mpz.cpp
index 8559279..7dca14b 100644
--- a/src/util/mpz.cpp
+++ b/src/util/mpz.cpp
@@ -134,7 +134,7 @@ mpz_manager<SYNCH>::mpz_manager():
#endif
mpz one(1);
- set(m_two64, UINT64_MAX);
+ set(m_two64, (uint64)UINT64_MAX);
add(m_two64, one, m_two64);
}

23
z3-stream-bool.patch Normal file
View File

@ -0,0 +1,23 @@
From f02d273ee39ae047222e362c37213d29135dc661 Mon Sep 17 00:00:00 2001
From: Jonathan Wakely <github@kayari.org>
Date: Tue, 2 Feb 2016 23:39:11 +0000
Subject: [PATCH] Convert stream to bool explicitly
In C++11 there is no implicit conversion from iostream classes to `void*`, just an explicit conversion to bool.
---
src/util/debug.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/src/util/debug.cpp b/src/util/debug.cpp
index 54c67fe..66676c6 100644
--- a/src/util/debug.cpp
+++ b/src/util/debug.cpp
@@ -76,7 +76,7 @@ void invoke_gdb() {
for (;;) {
std::cerr << "(C)ontinue, (A)bort, (S)top, (T)hrow exception, Invoke (G)DB\n";
char result;
- bool ok = (std::cin >> result);
+ bool ok = bool(std::cin >> result);
if (!ok) exit(ERR_INTERNAL_FATAL); // happens if std::cin is eof or unattached.
switch(result) {
case 'C':

11
z3.spec
View File

@ -8,7 +8,7 @@
Name: z3
Version: 4.4.1
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Satisfiability Modulo Theories (SMT) solver
License: MIT
@ -16,6 +16,10 @@ URL: https://github.com/Z3Prover/z3
Source0: https://github.com/Z3Prover/z3/archive/%{name}-%{version}.tar.gz
# Do not try to build with SSE2 on non-x86_64 arches
Patch0: %{name}-sse2.patch
# https://github.com/Z3Prover/z3/pull/427
Patch1: %{name}-stream-bool.patch
# https://github.com/Z3Prover/z3/commit/27399309009314f56cdfbd8333f287b1a9b7a3a6
Patch2: %{name}-ambiguous-overload.patch
BuildRequires: doxygen
BuildRequires: gmp-devel
@ -90,6 +94,8 @@ Python 2 interface to z3.
%prep
%setup -q -n %{name}-%{name}-%{version}
%patch0
%patch1 -p1
%patch2 -p1
# Install python objects into the right place, enable verbose builds, use
# Fedora CFLAGS, preserve timestamps when installing, include the entire
@ -258,6 +264,9 @@ chmod 0755 %{buildroot}%{_bindir}/* %{buildroot}%{_libdir}/*.so.0.0.0 \
%{python2_sitearch}/%{name}/
%changelog
* Tue Feb 02 2016 Jonathan Wakely <jwakely@redhat.com> - 4.4.1-3
- Patched for C++11 compatibility.
* Wed Jan 20 2016 Jerry James <loganjerry@gmail.com> - 4.4.1-2
- Add __init__.py to the python interface (bz 1298429)