summarylogtreecommitdiffstats
path: root/cork.patch
blob: 904c37c3abbf7bfd5e23399751649aff805d3dd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
diff --git a/Makefile b/Makefile
index a9fbb62..8ca986c 100644
--- a/Makefile
+++ b/Makefile
@@ -62,7 +62,7 @@ INC       := $(INC) $(GMPINC)
 # use the second line to disable profiling instrumentation
 # PROFILING := -pg
 PROFILING :=
-CCFLAGS   := -Wall $(INC) $(CONFIG) -O2 -DNDEBUG $(PROFILING)
+CCFLAGS   := -fPIC -Wall $(INC) $(CONFIG) -O2 -DNDEBUG $(PROFILING)
 CXXFLAGS  := $(CCFLAGS) $(CPP11_FLAGS)
 CCDFLAGS  := -Wall $(INC) $(CONFIG) -ggdb
 CXXDFLAGS := $(CCDFLAGS)
@@ -193,7 +193,7 @@ bin/off2obj: obj/off2obj.o
 
 obj/isct/triangle.o: src/isct/triangle.c
 	@echo "Compiling the Triangle library"
-	@$(CC) -O2 -DNO_TIMER \
+	@$(CC) $(CCFLAGS) -O2 -DNO_TIMER \
                -DREDUCED \
                -DCDT_ONLY -DTRILIBRARY \
                -Wall -DANSI_DECLARATORS \
diff --git a/src/mesh/mesh.isct.tpp b/src/mesh/mesh.isct.tpp
index a0acc15..69d33a8 100644
--- a/src/mesh/mesh.isct.tpp
+++ b/src/mesh/mesh.isct.tpp
@@ -650,14 +650,14 @@ public:
 	// DGM: to replace lambda in IsctProblem constructor!
 	void quantizeVerts(const Quantization& quantizer)
 	{
-		if (!mesh)
+		if (!TopoCache::mesh)
 			return;
 
-		size_t N = mesh->verts.size();
+		size_t N = TopoCache::mesh->verts.size();
 		quantized_coords.resize(N);
 
 		uint write = 0;
-		for (Vptr v = verts.getFirst(); v != NULL; v = verts.getNext(v))
+		for (Vptr v = TopoCache::verts.getFirst(); v != NULL; v = TopoCache::verts.getNext(v))
 		{
 #ifdef _WIN32
 			Vec3d raw = mesh->verts[v->ref].pos;
@@ -1106,7 +1106,7 @@ void Mesh<VertData,TriData>::IsctProblem::findIntersections()
     if(nTrys <= 0) {
         CORK_ERROR("Ran out of tries to perturb the mesh");
 		//std::logic_error
-		throw std::exception("Ran out of tries to perturb the mesh");
+		throw std::runtime_error("Ran out of tries to perturb the mesh");
         //exit(1);
     }
     
diff --git a/src/util/prelude.h b/src/util/prelude.h
index 6836ace..6981d20 100644
--- a/src/util/prelude.h
+++ b/src/util/prelude.h
@@ -60,7 +60,7 @@ std::ostream &err();
         err()     << "ENSURE FAILED at " \
                   << __FILE__ << ", line #" << __LINE__ << ":\n" \
                   << "    " << #STATEMENT << std::endl; \
-		throw std::exception("ENSURE FAILED"); \
+		throw std::runtime_error("ENSURE FAILED"); \
     } \
 }
 #endif // ENSURE