From dba5323e3a3958745afc3db8cefa3c3cded7ef2d Mon Sep 17 00:00:00 2001 From: trevor_hansen Date: Tue, 8 Feb 2011 12:22:10 +0000 Subject: [PATCH] Patch from Khoo Yit Phang. Add a workaround for GCC 4.0 which doesn't extend friendship to nested classes. See http://stackoverflow.com/questions/3584385/friend-access-to-protected-nested-class for details. git-svn-id: https://stp-fast-prover.svn.sourceforge.net/svnroot/stp-fast-prover/trunk/stp@1128 e59a4935-1847-0410-ae03-e826735625c1 --- src/AST/ASTInterior.h | 2 +- src/sat/cryptominisat2/PackedRow.h | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/AST/ASTInterior.h b/src/AST/ASTInterior.h index a6e6044..854dec4 100644 --- a/src/AST/ASTInterior.h +++ b/src/AST/ASTInterior.h @@ -29,7 +29,7 @@ namespace BEEV friend class STPMgr; friend class ASTNodeHasher; friend class ASTNodeEqual; - friend class HashingNodeFactory; + friend BEEV::ASTNode HashingNodeFactory::CreateNode(const Kind kind, const BEEV::ASTVec & back_children); private: /****************************************************************** diff --git a/src/sat/cryptominisat2/PackedRow.h b/src/sat/cryptominisat2/PackedRow.h index e59ff9b..8760998 100644 --- a/src/sat/cryptominisat2/PackedRow.h +++ b/src/sat/cryptominisat2/PackedRow.h @@ -219,14 +219,22 @@ public: friend std::ostream& operator << (std::ostream& os, const PackedRow& m); +#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ == 0)) +// Workaround for GCC 4.0 which doesn't extend friendship to nested classes. See +// http://stackoverflow.com/questions/3584385/friend-access-to-protected-nested-class +// for details. +public: +#else private: friend class PackedMatrix; +#endif PackedRow(const uint32_t _size, uint64_t* const _mp) : mp(_mp+1) , is_true_internal(*_mp) , size(_size) {} - + +private: uint64_t* __restrict const mp; uint64_t& is_true_internal; const uint32_t size; -- 2.47.3