mirror of
https://github.com/Z3Prover/z3
synced 2025-06-20 04:43:39 +00:00
fix build with prehistorical compilers because of pip/manylinux
This commit is contained in:
parent
ce4e1d3cbb
commit
6a45c5d17c
3 changed files with 15 additions and 22 deletions
|
@ -15,6 +15,7 @@ Notes:
|
||||||
|
|
||||||
#include "math/simplex/bit_matrix.h"
|
#include "math/simplex/bit_matrix.h"
|
||||||
#include "util/stopwatch.h"
|
#include "util/stopwatch.h"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
|
|
||||||
bit_matrix::col_iterator bit_matrix::row::begin() const {
|
bit_matrix::col_iterator bit_matrix::row::begin() const {
|
||||||
|
|
|
@ -16,11 +16,11 @@ Author:
|
||||||
Revision History:
|
Revision History:
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
#ifndef HEAP_H_
|
#pragma once
|
||||||
#define HEAP_H_
|
|
||||||
|
|
||||||
#include "util/vector.h"
|
#include "util/vector.h"
|
||||||
#include "util/debug.h"
|
#include "util/debug.h"
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
template<typename LT>
|
template<typename LT>
|
||||||
class heap : private LT {
|
class heap : private LT {
|
||||||
|
@ -290,6 +290,3 @@ public:
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif /* HEAP_H_ */
|
|
||||||
|
|
||||||
|
|
|
@ -23,14 +23,13 @@ Revision History:
|
||||||
|
|
||||||
|
|
||||||
--*/
|
--*/
|
||||||
#ifndef VECTOR_H_
|
#pragma once
|
||||||
#define VECTOR_H_
|
|
||||||
|
|
||||||
#include "util/debug.h"
|
#include "util/debug.h"
|
||||||
#include<algorithm>
|
#include <algorithm>
|
||||||
#include<type_traits>
|
#include <functional>
|
||||||
#include<memory.h>
|
#include <memory>
|
||||||
#include<functional>
|
#include <type_traits>
|
||||||
#include "util/memory_manager.h"
|
#include "util/memory_manager.h"
|
||||||
#include "util/hash.h"
|
#include "util/hash.h"
|
||||||
#include "util/z3_exception.h"
|
#include "util/z3_exception.h"
|
||||||
|
@ -79,7 +78,11 @@ class vector {
|
||||||
throw default_exception("Overflow encountered when expanding vector");
|
throw default_exception("Overflow encountered when expanding vector");
|
||||||
}
|
}
|
||||||
SZ *mem, *old_mem = reinterpret_cast<SZ*>(m_data) - 2;
|
SZ *mem, *old_mem = reinterpret_cast<SZ*>(m_data) - 2;
|
||||||
|
#if defined(__GNUC__) && !defined(__clang__) && __GNUC__ < 5
|
||||||
|
if (__has_trivial_copy(T)) {
|
||||||
|
#else
|
||||||
if (std::is_trivially_copyable<T>::value) {
|
if (std::is_trivially_copyable<T>::value) {
|
||||||
|
#endif
|
||||||
mem = (SZ*)memory::reallocate(old_mem, new_capacity_T);
|
mem = (SZ*)memory::reallocate(old_mem, new_capacity_T);
|
||||||
m_data = reinterpret_cast<T *>(mem + 2);
|
m_data = reinterpret_cast<T *>(mem + 2);
|
||||||
} else {
|
} else {
|
||||||
|
@ -107,13 +110,7 @@ class vector {
|
||||||
*mem = size;
|
*mem = size;
|
||||||
mem++;
|
mem++;
|
||||||
m_data = reinterpret_cast<T *>(mem);
|
m_data = reinterpret_cast<T *>(mem);
|
||||||
const_iterator it = source.begin();
|
std::uninitialized_copy(source.begin(), source.end(), begin());
|
||||||
iterator it2 = begin();
|
|
||||||
SASSERT(it2 == m_data);
|
|
||||||
const_iterator e = source.end();
|
|
||||||
for (; it != e; ++it, ++it2) {
|
|
||||||
new (it2) T(*it);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void destroy() {
|
void destroy() {
|
||||||
|
@ -445,7 +442,7 @@ public:
|
||||||
++pos;
|
++pos;
|
||||||
iterator e = end();
|
iterator e = end();
|
||||||
for(; pos != e; ++pos, ++prev) {
|
for(; pos != e; ++pos, ++prev) {
|
||||||
*prev = *pos;
|
*prev = std::move(*pos);
|
||||||
}
|
}
|
||||||
reinterpret_cast<SZ *>(m_data)[SIZE_IDX]--;
|
reinterpret_cast<SZ *>(m_data)[SIZE_IDX]--;
|
||||||
}
|
}
|
||||||
|
@ -651,5 +648,3 @@ struct vector_hash : public vector_hash_tpl<Hash, vector<typename Hash::data> >
|
||||||
|
|
||||||
template<typename Hash>
|
template<typename Hash>
|
||||||
struct svector_hash : public vector_hash_tpl<Hash, svector<typename Hash::data> > {};
|
struct svector_hash : public vector_hash_tpl<Hash, svector<typename Hash::data> > {};
|
||||||
|
|
||||||
#endif /* VECTOR_H_ */
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue