]> git.unchartedbackwaters.co.uk Git - francis/stp.git/commitdiff
Patch from Khoo Yit Phang.
authortrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 8 Feb 2011 12:22:10 +0000 (12:22 +0000)
committertrevor_hansen <trevor_hansen@e59a4935-1847-0410-ae03-e826735625c1>
Tue, 8 Feb 2011 12:22:10 +0000 (12:22 +0000)
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
src/sat/cryptominisat2/PackedRow.h

index a6e60443cfc3be8dfdae1e3f3955c3d4d2526ffd..854dec440693cd9f592322c959a4553304470d38 100644 (file)
@@ -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:
     /******************************************************************
index e59ff9b23f490237cabb9ba1f5622c91e5f7379d..876099886af970d35f0236ac357dfbd277250611 100644 (file)
@@ -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;