From e938c1774890aca8a1ce657b2df9d476a3faeb32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=ADtor=20Santos=20Costa?= Date: Fri, 29 Jun 2012 22:24:12 +0100 Subject: [PATCH] fix clang compilation (Denys Duchier). --- packages/swi-minisat2/C/SolverTypes.h | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/packages/swi-minisat2/C/SolverTypes.h b/packages/swi-minisat2/C/SolverTypes.h index 47e302390..f62cff827 100644 --- a/packages/swi-minisat2/C/SolverTypes.h +++ b/packages/swi-minisat2/C/SolverTypes.h @@ -119,11 +119,7 @@ public: // -- use this function instead: template - friend Clause* Clause_new(const V& ps, bool learnt = false) { - assert(sizeof(Lit) == sizeof(uint32_t)); - assert(sizeof(float) == sizeof(uint32_t)); - void* mem = malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size())); - return new (mem) Clause(ps, learnt); } + friend Clause* Clause_new(const V& ps, bool learnt = false); int size () const { return size_etc >> 3; } void shrink (int i) { assert(i <= size()); size_etc = (((size_etc >> 3) - i) << 3) | (size_etc & 7); } @@ -147,6 +143,12 @@ public: }; +template +Clause* Clause_new(const V& ps, bool learnt) { + assert(sizeof(Lit) == sizeof(uint32_t)); + assert(sizeof(float) == sizeof(uint32_t)); + void* mem = malloc(sizeof(Clause) + sizeof(uint32_t)*(ps.size())); + return new (mem) Clause(ps, learnt); } /*_________________________________________________________________________________________________ | | subsumes : (other : const Clause&) -> Lit